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. Advice about webview/engine on multi-platform

Advice about webview/engine on multi-platform

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 2 Posters 1.4k Views 3 Watching
  • 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.
  • V Offline
    V Offline
    VRHans
    wrote on last edited by
    #1

    Despite clearly selecting QtWebView 1.1 as an install option, qmake claims (on OSX) that webview is an unknown module (this *.pro file works fine on Windows.)

    So, I tried the nanobrowser sample - which builds fine on OSX, but qmake for iOS claims that webengine is an unknown module...

    If I need to, in QML, display a web page on Windows, Linux, OSX, Android, and iOS - am I supposed to be mixing/matching multiple Qt technologies?

    I can't discern from the documentation what works on which platform...

    Linux and Windows - webview works great for me.
    Android I haven't tried as I'm trying to get past iOS (usually the sticking point in my experience with any technology.)
    OSX - Apparently webengine can work (no idea why webview doesn't.)
    iOS?

    Any pointers on how to embed web via QML on iOS would be appreciated - thanks!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRHans
      wrote on last edited by
      #2

      I am viewing some videos online from the 2015 Qt World Summit and they suggest that QtWebView is supposed to work on all of these platforms... The speaker also mentions that you must set a special flag when building for OSX to have web view available - I installed from the official 5.5 installer DMG on OSX and WebView was selected as an extra - so I'm unsure why it doesn't seem to resolve when I add it to a Qt Creator sample project *.pro file and then run qmake on it...

      I am also confused as to why qmake doesn't know what it is when I try to build using the iOS simulator kit... Same problem, acts as though it has no idea what webview is...

      Weirdly, I get QML's WebView if I add webkit to the *.pro on the OSX machine, and import webkit 3.0 in the QML file.

      This doesn't work on Windows though - although I think on Windows I'm using 5.6 of Qt (because I'm running VS 2015) - is web stuff getting re-organized between the two versions?

      Anyhow - the iOS Simulator build kit selection still fails with webkit on 5.5 when I run qmake against the PRO that works fine for OSX now.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        What you need for iOS and Android is the QtWebView module. There's no QtWebKit not QtWebEngine available for them because of platform owner (Apple, Google) restrictions. So be sure to add QT += webview to your .pro file for these platforms.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VRHans
          wrote on last edited by VRHans
          #4

          Thanks :)

          I realized this, this afternoon - basically:

          //import QtWebView 1.1
          import QtWebKit 3.0
          

          For OSX, and for iOS

          import QtWebView 1.1
          //import QtWebKit 3.0
          

          I haven't figured out how to import based upon build kit, but I presume the worst case scenario would be to have multiple QML files (one for each platform that requires different imports.) No?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            You can follow the structure proposed in QQmlFileSelector

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • V Offline
              V Offline
              VRHans
              wrote on last edited by
              #6

              Cool, thx :)

              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