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. QWebView low FPS rate
Forum Updated to NodeBB v4.3 + New Features

QWebView low FPS rate

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 2 Posters 2.1k Views 2 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.
  • M Offline
    M Offline
    matteo
    wrote on last edited by
    #1

    Hi, I'm new to qt, right now i'm using qt creator 3.1.0 based on qt 5.2.1. I'm trying to display an html page containing the "Cesium ":http://cesiumjs.org/ globe written in javascript using WebGL features.
    I'm facing with fluency issues since that my application can't reach the 60 FPS rate reached with the chrome browser.
    I have tried to to use both QWebView and QGraphicsWebView and to load in the page both my html file from qrc and a page directly from the internet like this one: http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html
    (loading directly from internet the application freezes).
    Here there is my code:

    @#include <QApplication>
    #include <QWebView>
    #include <QWebPage>
    #include <QGraphicsView>
    #include <QGraphicsWebView>
    #include <QGLWidget>

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

    int width = 1500;
    int height = 900;
    
    /*  
    //using QWebView
    QWebSettings::globalSettings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::WebGLEnabled, true);
    QWebView *webView = new QWebView();
    webView->load(QUrl("qrc:/Resources/NewFile.html"));
    //webView->load(QUrl("http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html"));
    webView->resize(width, height);
    webView->show();
    */
    
    
    //using QGraphicsWebView
    QGraphicsView *gview;
    QGraphicsScene *scene;
    QGraphicsWebView *web_view;
    
    QWebSettings::globalSettings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, true);
    QWebSettings::globalSettings()->setAttribute(QWebSettings::WebGLEnabled, true);
    gview = new QGraphicsView();
    gview->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
    gview->setViewport(new QGLWidget());
    
    scene = new QGraphicsScene(gview);
    web_view = new QGraphicsWebView();
    
    scene->addItem(web_view);
    gview->setScene(scene);
    
    web_view->load(QUrl("qrc:/Resources/NewFile.html"));
    //web_view->load(QUrl("http://cesiumjs.org/Cesium/Build/Apps/CesiumViewer/index.html"));
    
    web_view->resize(width, height);
    gview->resize(width+50, height+50);
    gview->show();
    
    return a.exec&#40;&#41;;
    

    }@

    I don't now if that issue depends on the javascript engine used by qt, or if there is the possibility to built qt for a specific machine in order to get better results, or even more i'm dealing wrong with the settings of my application. I'm just supposing.

    Any ideas or suggestings?
    Thanks in advance.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kmbar2013
      wrote on last edited by
      #2

      Was there ever a resolution to this?

      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