Bug 58568

Summary: Unity3d web plugin and QGraphicsWebView
Product: WebKit Reporter: qtnext <qtnext>
Component: Plug-insAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Blocker CC: andersca, girish
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   

Description qtnext 2011-04-14 13:51:12 PDT
I have an application done in QML or with QGraphicsWebView . I need to be able to display a qml webview that display a unity3D plugin web page. for example : http://download.unity3d.com/gallery/live-demos

It works fine if for example I enter this url in the Qt (C++) browser demo, but when I try to load this url in a qml webview or a QGraphicsWebView … I see only a black screen … and when I quit my apps I see a crash report from unity3D ( I display QML using opengl viewport). what can be different from a normal qwebview …

I was thinking that it was an opengl issue … but if I launch the c++ browser demo with -graphicssystem opengl … It works fine, it’s only when it’s using in QML (for information I use Windows Seven platform). I don’t know what’s happen !

Here an easy trouble example :

you need to download unity3D plugin in chrome before  :(http://unity3d.com/webplayer/)

#include <QtGui/QApplication>

#include <QWebView>
#include <QGraphicsView>
#include <QGraphicsWebView>

static const QUrl URL = QUrl("http://download.unity3d.com/gallery/live-demos");

static const int RESOLUTION_X = 1920;
static const int RESOLUTION_Y = 1080;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QWebView * view = new QWebView;
    view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    view->setUrl(URL);

    view->setFixedSize(RESOLUTION_X, RESOLUTION_Y);

    view->setWindowTitle("WebView");
    view->show();

    //---------------------------------------------------------------------------------------------

    QGraphicsScene * scene = new QGraphicsScene();
    QGraphicsView * graphicsView = new QGraphicsView(scene);

    QGraphicsWebView * graphicsWebView = new QGraphicsWebView;
    graphicsWebView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    graphicsWebView->setUrl(URL);
    scene->addItem(graphicsWebView);

    scene->setSceneRect(QRect(0, 0, RESOLUTION_X, RESOLUTION_Y));
    graphicsWebView->resize(RESOLUTION_X, RESOLUTION_Y);


    graphicsView->setFixedSize(RESOLUTION_X, RESOLUTION_Y);

    graphicsView->setWindowTitle("GraphicsWebView");
    graphicsView->show();

    return a.exec();
}