WebKit using the same principles of a smartphone navigation



  • Hi,

    I would like to create a WebKit using the same principles of a smartphone navigation.

    I found this page http://qt-project.org/doc/qt-5/qtwebkit-goes-mobile.html.

    But when I use the cursor like a finger it doesn't work (the cursor selects the text and does not move my page).

    Could you help me with my code please?

    @#include <QApplication>
    #include <QtWidgets>
    #include <QtWebKitWidgets/QGraphicsWebView>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    const int width = 640;
    const int height = 480;

    QGraphicsScene scene;
    
    QGraphicsView view(&scene);
    view.setFrameShape(QFrame::NoFrame);
    view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    
    QGraphicsWebView webview;
    webview.resize(width, height);
    webview.setResizesToContents(true);
    webview.settings()->setAttribute(QWebSettings::FrameFlatteningEnabled, true);
    webview.load(QUrl("http://doc.qt.nokia.com/"));
    
    
    scene.addItem(&webview);
    
    view.resize(width, height);
    view.show();
    
    return app.exec();
    

    }
    @

    Thanks,
    Fx


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.