WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
24157
Flash content not visible if QWebView is inside QGraphicsView
https://bugs.webkit.org/show_bug.cgi?id=24157
Summary
Flash content not visible if QWebView is inside QGraphicsView
Lasse Holmstedt
Reported
2009-02-25 05:00:18 PST
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(); }
Attachments
Add attachment
proposed patch, testcase, etc.
Simon Hausmann
Comment 1
2009-10-06 04:55:17 PDT
What's missing for this to work in all cases is support for also redirecting the output of windowed plugins, for example using the composite and damage extensions on X11.
Girish Ramakrishnan
Comment 2
2009-12-14 07:54:34 PST
Should we close this bug? I think we support Flash in QGraphicsWebView now but not in QWebView. I don't think it's useful to support flash in QWebView. Comments? As for QGraphicsWebView, see the following related bugs Windows - 32059 Mac - Fixed by 31183 , 31794, 31979. Linux - 20081, 32059 See also :
http://blog.forwardbias.in/2009/12/flash-in-qgraphicsview.html
.
Girish Ramakrishnan
Comment 3
2009-12-14 07:55:40 PST
(In reply to
comment #2
)
> Should we close this bug? I think we support Flash in QGraphicsWebView now but > not in QWebView. I don't think it's useful to support flash in QWebView. > Comments? >
Err. To clarify, I don't think its useful to support flash in a QWebView that is embedded in QGraphicsView using QGraphicsProxyWidget.
Jocelyn Turcotte
Comment 4
2010-03-08 06:02:15 PST
This is a valid issue however the usecase seems exotic. The normal way to achieve this would be to use the QGraphicsWebView introduced in Qt 4.6. Please reopen if this solution do not meet the need.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug