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. [Solved] Error: QtWebKit 3.0 module not found
QtWS25 Last Chance

[Solved] Error: QtWebKit 3.0 module not found

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

    Hi,

    I am currently writing an application in C++ which is supposed to load a qml file and show a WebView and I have an error when trying to import QtWebKit 3.0 in my qml file.

    ERROR
    file:///C:/DEVELOPMENT/myQml.qml:2:1: plugin cannot be loaded for module "QtWebKit": Cannot load library C:/DEVELOPMENT/QtWebKit/qmlwebkitplugin.dll: The specified module could not be found.
    import QtWebKit 3.0

    My setup is as follows:
    I have a C++ Application which uses QApplication and QQuickView to load a qml file
    C++
    @
    QApplication app(argc, &argv);
    QQuickView view(QUrl::fromLocalFile("myQml.qml"));
    app.exec();
    @

    For the QML file I simply used the example from the "QT Webkit WebView":http://doc.qt.io/qt-5/qml-qtwebkit-webview.html
    @
    import QtQuick 2.0
    import QtQuick.Controls 1.0
    import QtWebKit 3.0

    ScrollView {
    width: 1280
    height: 720
    WebView {
    id: webview
    url: "http://qt-project.org"
    anchors.fill: parent
    onNavigationRequested: {
    // detect URL scheme prefix, most likely an external link
    var schemaRE = /^\w+:/;
    if (schemaRE.test(request.url)) {
    request.action = WebView.AcceptRequest;
    } else {
    request.action = WebView.IgnoreRequest;
    // delegate request.url here
    }
    }
    }
    }
    @

    The execution folder of the .exe file contains the subfolder QtWebKit as well as the subfolder QtQuick.2 where I thought the plugins are stored.
    When I tried to run an example using QtQuick 1.0 and QtWebKit 1.0 and the (deprecated ) QDeclarativeView it worked.

    I used the Qt Version 5.4 installation package for 64bit windows and opengl support and the plugins therein. I use Visual Studio 2013 to compile the C++ application.
    Does anyone have an idea where this could come from? Thanks in advance.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JanHi
      wrote on last edited by
      #2

      Hi folks,

      I figured the problem out myself and in case someone else encounters this problem, here is what worked for me:

      I ran dependency walker and only found dependencies on Core, Gui, QML, Quick and Widget (which I included in the folder of the executable).

      Apparently what was missing were dependencies for
      Multimedia, MultimediaWidget, Network, OpenGL, Positioning, PrintSupport, Sensors, Sql, WebChannel, WebKit, WebKitWidgets and the QtWebProcess.exe. I have no idea why this would be needed or why the error message did not say anything about it but it silently worked when adding these libraries to the folder of the executable. I followed these "deployment instructions":http://qt-project.org/wiki/Deploy_an_Application_on_Windows to figure out which libraries were necessary. Sadly I did not find any documentation about which modules have which dependencies so there is only the trial and error method described there.

      Best Regards,
      Jan

      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