module "QtWebEngine" is not installed



  • I am porting from QGraphicsWebView to QWebEngineView.
    There is corresponding QML for QGraphicsWebView.
    I replaced GraphicsWebView with WebEngineView.
    Had included import QtWebEngine.

    Getting error as module "QtWebEngine" is not installed

    But I have the QtWebEngine installed in my Qt directory for QML.
    Kindly let me know , what is to be done to make the QtWebEngine available in QML



  • Hi,
    Two things come to my mind:

    • QT += webengine
    • #include <QtWebEngine/qtwebengineglobal.h> and QtWebEngine::initialize(); in your main.cpp


  • Thanks for the reply. But still I find the same issue even after including ur suggestion :(:(


  • Moderators

    @ejos Which Qt version are you using ?
    Did you select it while installing Qt ?



  • yes. I am using Qt 5.4

    I could find the QtWebEngine folder inside the Qt/src/qml


  • Moderators

    @ejos Ok. Do you see QtWebEngine folder under gcc_64/qml (not src) ?
    On my Linux system complete path is /opt/Qt5.4.1/5.4/gcc_64/qml/QtWebEngine viz. Qt installed directory.



  • Yes I am able to find.
    DTPC-184N:QtWebEngine user$ cd /Applications/QT/5.4/clang_64/qml/QtWebEngine
    DTPC-184N:QtWebEngine user$ ls -lrt
    total 416
    -rw-r--r-- 1 root admin 70 Feb 13 15:55 qmldir
    -rw-r--r-- 1 root admin 5786 Feb 13 15:56 plugins.qmltypes
    drwxr-xr-x 5 root admin 170 Feb 13 15:56 experimental
    drwxr-xr-x 10 root admin 340 Feb 13 15:56 UIDelegates
    -rwxr-xr-x 1 root admin 56836 Feb 13 15:57 libqtwebengineplugin.dylib
    -rwxr-xr-x 1 root admin 139492 Feb 13 15:57 libqtwebengineplugin_debug.dylib


  • Moderators

    @ejos Well I'm also not sure why it not works on Mac. May be someone else with that platform knowledge would answer. Or try reinstalling it once. QtWebEngine is supposed to work on Mac too. https://wiki.qt.io/QtWebEngine



  • While using QWebEngineView , Is there an option like QDeclarativeContext / QDeclarativeEngine where to QML context is set from CPP file.


  • Moderators

    @ejos No, atleast I haven't come across. QWebEngineView is a pure C++ class.
    Did you try reinstalling ?



  • haven't tried yet, will do that.
    After including the includes QtQuick or QQml in the header file getting errors as below

    In file included from ../ssparkl/readwidget.h:21:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/QQuickView:1:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Versions/5/Headers/qquickview.h:37:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/qquickwindow.h:42:
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:62:5: error: redefinition of enumerator 'QML_HAS_ATTACHED_PROPERTIES'
    QML_HAS_ATTACHED_PROPERTIES = 0x01

    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/QQuickView:1:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Versions/5/Headers/qquickview.h:37:
    In file included from /Applications/QT/5.4/clang_64/lib/QtQuick.framework/Headers/qquickwindow.h:42:
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:61:1: warning: declaration does not declare anything [-Wmissing-declarations]
    enum { /* TYPEINFO flags */
    ^~~~
    /Applications/QT/5.4/clang_64/lib/QtQml.framework/Headers/qqml.h:99:5: error: redefinition of 'qmlRegisterType'
    int qmlRegisterType()

    kindly help to resolve this issue


  • Moderators

    @ejos What did you include and where ?



  • The issue was with mismatch of QDeclarativeView and QQuickView use simultaneously. The issue is resolved once I changed all QDeclarativeView to QQuickView.

    Thanks for replies


Log in to reply
 

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