Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. qml - qtwebview - webview. Does it support eval javascript inside somehow?

qml - qtwebview - webview. Does it support eval javascript inside somehow?

Scheduled Pinned Locked Moved QML and Qt Quick
webview webkit
6 Posts 2 Posters 2.7k 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.
  • 0 Offline
    0 Offline
    0hno
    wrote on 28 Apr 2015, 21:24 last edited by 0hno
    #1

    I develop application for iOS and I use qml - qtwebview - webview component to show the web page inside my iOS application. How I could evaluate javascript inside webpage?
    Here are strange situatuon in Qt documentation, here two pages with docs:
    http://doc.qt.io/qt-5.4/qml-qtwebkit-webview.html (webview from qtwebkit module)
    http://doc.qt.io/qt-5.4/qml-qtwebview-webview.html (webview from qtwebview module)
    I am using second component, because it only work for iOS, but in docs no information about signals/methods, but some signals functions from webkit/webview actually works here in qtwebview/webview (for example onLoadingChanged(loadRequest)).
    So I am confused by this fact. I want to know how i can evaluate javascript inside html representing by qtwebview/webview component, and how I can explore HTML elements inside qtwebview/webview, and how i can handle signals such loadPage?

    P 1 Reply Last reply 29 Apr 2015, 11:56
    0
    • 0 0hno
      28 Apr 2015, 21:24

      I develop application for iOS and I use qml - qtwebview - webview component to show the web page inside my iOS application. How I could evaluate javascript inside webpage?
      Here are strange situatuon in Qt documentation, here two pages with docs:
      http://doc.qt.io/qt-5.4/qml-qtwebkit-webview.html (webview from qtwebkit module)
      http://doc.qt.io/qt-5.4/qml-qtwebview-webview.html (webview from qtwebview module)
      I am using second component, because it only work for iOS, but in docs no information about signals/methods, but some signals functions from webkit/webview actually works here in qtwebview/webview (for example onLoadingChanged(loadRequest)).
      So I am confused by this fact. I want to know how i can evaluate javascript inside html representing by qtwebview/webview component, and how I can explore HTML elements inside qtwebview/webview, and how i can handle signals such loadPage?

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 29 Apr 2015, 11:56 last edited by
      #2

      Hi @0hno
      AFAIK it doesn't support it. WebView is just a wrapper around the native browser and hence has more limited API.

      157

      1 Reply Last reply
      0
      • 0 Offline
        0 Offline
        0hno
        wrote on 30 Apr 2015, 06:17 last edited by
        #3

        Thank you for answer, p3c0.
        I have just read new features of qt 5.5 alpha version, and I found note about this component (qtwebview - webview). There was exactly what I need (evaluate javascript etc), but it only for version 5.5 alpha. So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

        P 1 Reply Last reply 30 Apr 2015, 07:04
        0
        • 0 0hno
          30 Apr 2015, 06:17

          Thank you for answer, p3c0.
          I have just read new features of qt 5.5 alpha version, and I found note about this component (qtwebview - webview). There was exactly what I need (evaluate javascript etc), but it only for version 5.5 alpha. So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

          P Offline
          P Offline
          p3c0
          Moderators
          wrote on 30 Apr 2015, 07:04 last edited by
          #4

          @0hno

          So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

          I haven't tested it with ios yet but it should work on it. Let us know :)

          157

          0 1 Reply Last reply 30 Apr 2015, 15:38
          0
          • P p3c0
            30 Apr 2015, 07:04

            @0hno

            So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

            I haven't tested it with ios yet but it should work on it. Let us know :)

            0 Offline
            0 Offline
            0hno
            wrote on 30 Apr 2015, 15:38 last edited by
            #5

            @p3c0:

            @0hno

            So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

            I haven't tested it with ios yet but it should work on it. Let us know :)

            I successfully use QWebChannel now under iOS and under Windows. It works fine on both OS.

            P 1 Reply Last reply 1 May 2015, 04:58
            0
            • 0 0hno
              30 Apr 2015, 15:38

              @p3c0:

              @0hno

              So now the only way to communicate between application and html in webview inside your app under iOS is QWebChannel.

              I haven't tested it with ios yet but it should work on it. Let us know :)

              I successfully use QWebChannel now under iOS and under Windows. It works fine on both OS.

              P Offline
              P Offline
              p3c0
              Moderators
              wrote on 1 May 2015, 04:58 last edited by
              #6

              @0hno Cool. Thanks for sharing.

              157

              1 Reply Last reply
              0

              2/6

              29 Apr 2015, 11:56

              4 unread
              • Login

              • Login or register to search.
              2 out of 6
              • First post
                2/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved