Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QGraphicsWebView and Flash performance issue
Forum Updated to NodeBB v4.3 + New Features

QGraphicsWebView and Flash performance issue

Scheduled Pinned Locked Moved Qt WebKit
3 Posts 2 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bunjee
    wrote on last edited by
    #1

    Greetings,

    It seems that the performance of Flash is not as good in a QGraphicsWebView than in a QWebView.

    I did a small test example to demonstrate this.

    I'm running this on Windows 7 + Qt 4.7.1 on an i7 but I did reproduce it on OS-X :
    @#include <QtGui/QApplication>

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

    static const QUrl URL = QUrl("http://www.warriorlabs.net/index.php?app=ccs&module=pages&section=pages&folder=/music&id=26");

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

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

    //---------------------------------------------------------------------------------------------
    // Instructions :
    //
    // Start the video by clicking inside each web view.
    //
    // The QWebView is performing better than the QGraphicsWebView with the very same HTML.
    //
    
    //---------------------------------------------------------------------------------------------
    // QWebView > Good performances
    
    QWebView * view = new QWebView;
    view->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    view->setUrl(URL);
    
    view->setFixedSize(RESOLUTION_X, RESOLUTION_Y);
    
    view->setWindowTitle("WebView");
    view->show();
    
    //---------------------------------------------------------------------------------------------
    // QGraphicsWebView > Slow performances
    
    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(&#41;;
    

    }@

    Anyone knows why this happens ? Is this due to caching or graphical performances ?

    I'm not 100% sure about this but it seems that if I load the QWebPage with the QGraphicsWebView and then switches it inside the QWebView I inherit the poor performances. Could this come from an external factor like QWebSettings ?

    Thanks for your insights.

    B.A.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      micha4fun
      wrote on last edited by
      #2

      I experienced the same problem. Does probably anyone have a workaround for this?

      Best Regards,
      Micha

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bunjee
        wrote on last edited by
        #3

        I guess we'll have to wait for Qt 4.8 and QtWebkit 2.2.

        B.A.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved