QML QtWebView unable to load page on Windows 7
-
Hi!
I created a simple app for a test of webview.
On Ubuntu 14.04 (Qt5.6.0, GCC 4.9.1, 64 bit) it works great. But on Windows 7 (Qt5.6.1, MSVC 2013, 32 bit) when i'm trying to load this page, there is only a white page. Any page..pro
QT += qml quick webview
main.cpp
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QtWebView> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QtWebView::initialize(); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
main.qml
import QtQuick 2.6 import QtQuick.Window 2.2 import QtWebView 1.0 Window { id: main visible: true width: 1280 height: 720 WebView { id: webview anchors.fill: parent url: "https://forum.qt.io/" } }
What should I turn on or something?
Thanks for help. -
@Alexorleon Are you using official Qt binaries on Windows? In this case you need to compile QtWebKit from sources, which can be downloaded here: http://download.qt.io/community_releases/5.6/5.6.1/
-
@Konstantin-Tokarev yes! Ok, I'll try. Thank you. Topic closed after.
-
I replaced the WebView to WebEngineView. Works great.
.pro
QT += qml quick webengine
main.cpp
#include <QtWebEngine/qtwebengineglobal.h> QtWebEngine::initialize();
main.qml
import QtWebEngine 1.0 WebEngineView { id: webview anchors.fill: parent url: "http://forum.qt.io/" }
-
Hi,
@Alexorleon the qtwebview module can be used on platform that provides a "native web view" like iOS, macOS, Android and WinRT.