Quantcast
Channel: Qt DevNet forums: Qt WebKit
Viewing all articles
Browse latest Browse all 542

WebKit using the same principles of a smartphone navigation

$
0
0
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

Viewing all articles
Browse latest Browse all 542

Trending Articles