WebView on OS X



  • I have been trying to use QtWebView 1.0 in qml on os x 10.11. I have qt 5.5.1.

    import QtQuick 2.5
    import QtQuick.Window 2.2
    import QtWebView 1.0
    
    Window {
        visible: true
        height:1024
        width: 768
    
        WebView {
            id: web
            anchors.fill: parent
            url: "https://www.google.com"
        }
    }
    

    My screen shows up as white blank empty page. I am wondering if this bug: Qtbug 46792 is my actual problem. I am really interested in the webview as my app runs on most desktop platforms, android and ios(webview would allow me to not have my app rejected in apple app store). My question is have other people experienced this problem and if so what have you done for workaround? I think I have 2 options, wait for it to get fixed(which I can't tell when that will happen) or use webview for all platforms but os x and try another web framework qt provides. Any ideas would be most helpful. Thanks!



  • Hi,

    as far as I know, in Qt 5.5.x WebView is implemented as a wrapper of QtWebEngine; so you need to initialize WebEngine in main.cpp

    QtWebEngine::initialize()
    

    I suggest to have a look to the Minibrowser Example code



  • Thanks for the response. I thought WebView didn't use chromium underneath but instead native where it could and webkit for anywhere else? I know I can't use qtwebengine as I do need to submit to the apple app store. I did try the initialize but didn't change anything.



  • There was a plan to implement WebView in native code for OS X (as is now for Android and iOS) but I don't know about the current implementation.

    I suggest to contact the qt developers (mailing list or IRC)


  • Lifetime Qt Champion

    Hi,

    It's the QtWebView module that offers a wrapper around OS X, iOS and Android web views.


Log in to reply
 

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