[Webkit-unassigned] [Bug 24157] New: Flash content not visible if QWebView is inside QGraphicsView
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Feb 25 05:00:19 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=24157
Summary: Flash content not visible if QWebView is inside
QGraphicsView
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
OS/Version: Mac OS X 10.5
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: WebKit Qt
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: lasse.holmstedt at gmail.com
When loading Flash content in a QWebView which is added inside QGraphicsView,
the Flash content is not visible at all. It works, however, because JavaScript
calls to the Flash object get through to it.
If QWebView is added under some other container, like QMainWindow, Flash works
just fine and everything is displayed. JavaScript works too as expected.
The build used to test the problem was 41149, but it occurs with the build
currently shipping with Qt 4.5.0-tp1 as well.
On the Flash side, following steps are required:
* ExternalInterface.addCallback("funcnameForJs", asFuncName);
On JS side, the script has to first wait for the Flash to be 100% initialized.
After that, the call
document.getElementById(flashElementName).funcnameForJs()
can be made. This will show that the Flash itself does, in fact, work, it's
just not visible. There must be other, easier ways to do it too though.
This example does NOT work as expected, and shows the real issue:
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindowClass), editorObj(this)
{
ui->setupUi(this);
QString projpath("/your/path/here");
QGraphicsView* graphicsView = new QGraphicsView(this);
QGraphicsScene* scenePtr = new QGraphicsScene(graphicsView);
webview = new QWebView();
graphicsView->setScene(scenePtr);
scenePtr->addWidget(webview);
graphicsView->resize(800, 800);
graphicsView->move(300, 50);
webview->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webview->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled,
true);
webview->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
webview->load(QUrl("file://" + projpath +
"/someFlashAndJSEnabledFile.html"));
webview->resize(600, 400);
webview->show();
QWidget* centralWidgetPtr = &editorObj;
this->setCentralWidget(centralWidgetPtr);
}
As for Qt, one can for example do this working setup in a class that inherits
QMainWindow:
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindowClass)
{
ui->setupUi(this);
QString projpath("/your/path/here");
webview = new QWebView(this);
webview->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webview->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled,
true);
webview->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
webview->load(QUrl("file://" + projpath +
"/someFlashAndJSEnabledFile.html"));
webview->resize(600, 400);
webview->show();
}
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list