Important: Please read the Qt Code of Conduct -

QTWebview for Android with C++

  • Hi everyone,

    After read and search about the Webkit, i still not figure out know do what I need, I hope you can clarify my doubts.
    I'm working in a project with Qwebview in desktop(windows, qt5.9,minGW) that the only thing that have to do is access to a camera via IP and work fine...everything is ok...but now I'm trying to do the same for android (armv 7) of what I read Qwebview dont work in android, but there is the QTwebview that is for all platforms, but my problem is that in for QML Application and my programm is in C++.

    Is there anyway how use QTwebview without QML?


  • Currently only QML API is public

  • Thanks for the answer, is there other way to do it just with C++??....

  • AFAIU, it's believed that QWidget-based UIs are unusable on mobile. However, if you are really inclined to avoid QML, you have 3 options:

    • Use private C++ API of Qt WebView. You'll probably need to fork QtWebView module if you want to avoid dealing with QQuickView completely
      • As a variation, you can insert QQuickWidget into your UI with minimal QML source which sets up WebView
    • Use Android API directly (this implies writing Java, in a manner similar to how QtWebView is implemented internally). This way will give you more control over web view, as API of QtWebView (previous option) is very limited
    • Use QtWebKit. There is no out of the box support of Android yet, but some people reported that they could run it successfully there. A bit of build system patching will be required, but there are some known 3rd party patches that will probably help. This is the best option if you need total control over web view, but it requires shipping QtWebKit with your application (as opposed to use of built-in web engine in the first two options)

  • After looking what would be better for the programm, I think option 1 would be better, can you explain me more about the variation, use a QQuickWidget in my UI with minimal QML source?
    cause my knowledge of QML are null >.<

  • Moderators

    hi @Miguel-Lujan
    qt has some good examples that should get you startet

Log in to reply