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. QML QtWebView unable to load page on Windows 7
Forum Updated to NodeBB v4.3 + New Features

QML QtWebView unable to load page on Windows 7

Scheduled Pinned Locked Moved Solved Qt WebKit
6 Posts 3 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.
  • AlexorleonA Offline
    AlexorleonA Offline
    Alexorleon
    wrote on last edited by
    #1

    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.

    K 1 Reply Last reply
    0
    • AlexorleonA Alexorleon

      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.

      K Offline
      K Offline
      Konstantin Tokarev
      wrote on last edited by
      #2

      @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/

      AlexorleonA 1 Reply Last reply
      2
      • K Konstantin Tokarev

        @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/

        AlexorleonA Offline
        AlexorleonA Offline
        Alexorleon
        wrote on last edited by
        #3

        @Konstantin-Tokarev yes! Ok, I'll try. Thank you. Topic closed after.

        1 Reply Last reply
        0
        • AlexorleonA Offline
          AlexorleonA Offline
          Alexorleon
          wrote on last edited by
          #4

          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/"
              }
          
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            @Alexorleon the qtwebview module can be used on platform that provides a "native web view" like iOS, macOS, Android and WinRT.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            AlexorleonA 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              @Alexorleon the qtwebview module can be used on platform that provides a "native web view" like iOS, macOS, Android and WinRT.

              AlexorleonA Offline
              AlexorleonA Offline
              Alexorleon
              wrote on last edited by
              #6

              @SGaist thanks, I'll keep it in mind.

              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