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



  • 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?


  • Moderators

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



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


  • Moderators

    @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 :)



  • @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.


  • Moderators

    @0hno Cool. Thanks for sharing.


Log in to reply
 

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