[BUG REPORTED] WebView Problem



  • I have the following code
    @
    import QtQuick 2.2
    import QtWebKit 3.0

    Rectangle{
    id: root

    WebView{ // 1
    id: webView
    url: "http://qt-project.org"

    onLinkHovered: { // 2
      console.log("onLinkHovered");
    }
    onLoadingChanged: { // 3
      console.log("onLoadingChanged");
    }
    onNavigationRequested: { // 4
      console.log("onNavigationRequested");
    }
    

    }
    }
    @

    like the "example":http://qt-project.org/doc/qt-5/qtwebkit-index.html but get the following

    Using Qt Quick code model 1 instead of Qt Quick 2. (M324)

    Invalid property name 'onLinkHovered'. (M16)

    Invalid property name 'onLoadingChanged'. (M16)

    Invalid property name 'onNavigationRequested'. (M16)

    How can I correct this?

    Thanks.

    Steve



  • BTW, although "WebView":http://qt-project.org/doc/qt-5/qml-qtwebkit-webview.html says nothing about what to include in a .pro file, I used

    bq. QT += webkit webkitwidgets widgets

    Is this correct?


  • Moderators

    Hi,

    According to https://bugreports.qt-project.org/browse/QTCREATORBUG-11040 try restarting Qt Creator.

    [quote author="SteveG" date="1394314495"]BTW, although "WebView":http://qt-project.org/doc/qt-5/qml-qtwebkit-webview.html says nothing about what to include in a .pro file, I used

    bq. QT += webkit webkitwidgets widgets

    Is this correct?[/quote]QML dependencies are auto-detected through the "import" statements, so they don't need to be declared in the .pro file.

    Since the Qt WebKit module is QML-only, you never need "QT += webkit".

    The Qt WebKit Widgets module contains the C++ components that are based on an older version of WebKit. Declare "QT += webkitwidgets" if you want to use QWebView et al.

    "QT += widgets" is for the basic widgets (QLabel, QPushButton, etc.)



  • JKSH,

    I appreciate your clarifications and I will remove the QT statement in my .pro file.

    Restarting Qt Creator has no effect. I filed bug report QTCREATORBUG-11666.

    Thanks.

    Steve



  • I am facing the same problem. This is also described in the bug report: https://qt-project.org/forums/viewthread/39374
    How to solve this?



  • I also have same problem, I tried with QtWebKit 1.0 and 3.0 but is same. Desktop build works fine but Android marks as "Using Qt Quick code model 1 instead of Qt Quick 2. (M324)" in green and "Invalid property name ‘onNavigationRequested’. (M16)" in same example.

    I'm having problems adding a map in Android and I tried this but is the same.

    Using: Qt Creator 3.3 and Qt 5.4.0



  • I also have same problem, I tried with QtWebKit 1.0 and 3.0 but is same. Desktop build works fine but Android marks as "Using Qt Quick code model 1 instead of Qt Quick 2. (M324)" in green and "Invalid property name ‘onNavigationRequested’. (M16)" in same example.

    I'm having problems adding a map in Android and I tried this but is the same.

    Using: Qt Creator 3.3 and Qt 5.4.0


Log in to reply
 

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