Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [BUG REPORTED] WebView Problem

[BUG REPORTED] WebView Problem

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 3.0k 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.
  • S Offline
    S Offline
    SteveG
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SteveG
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        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.)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SteveG
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qt_like
            wrote on last edited by
            #5

            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?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Chechesa
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Chechesa
                wrote on last edited by
                #7

                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

                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