Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. display Html file in QT C++ with Webview ?
Forum Updated to NodeBB v4.3 + New Features

display Html file in QT C++ with Webview ?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 280 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.
  • B Offline
    B Offline
    Brad1111
    wrote on last edited by
    #1

    Hello,

    I need a way to display an html file, with the notion of page format - left margin, right margin, etc, which doesnt work properly with Textedit or textbrowser unless Im mistaken.
    Also I need it to work on mobile so apparently I cant use WebEngineCore which only is supported on desktop , and I think I'm left with QWebView ? But isn't it for QML Qt Quick only while Im on Qt c++.

    Any advice please ?

    JoeCFDJ 1 Reply Last reply
    0
    • B Brad1111

      @JoeCFD None of the QWebEngine functionalities are supported on mobile - Android/iOS - Or am I wrong ?
      I assume that leaves me with the only option left, that is to mix qml with widgets .. which I have no idea how to do -_-''
      Please kindly confirm that I cant use QWebEngineWidgets on mobile and I'll mark your message as solution. I'll have to read how to mix these things
      Thank you

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #4

      @Brad1111 It seems that web engine is not supported on Android. To mix qml with widgets. You can use

      class VideoWidget : public QQuickWidget
      {
          Q_OBJECT 
      };
      
      in the construtor, add your qml to it
         QUrl qml_source( "qrc:path/***.qml" );
         setSource( qml_source );
      

      https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/quick/quickwidgets/quickwidget?h=6.8

      If you project is not too big, you can use qml only. I mixed them only in one project, but I prefer to make pure widgets or qml projects.

      B 1 Reply Last reply
      1
      • B Brad1111

        Hello,

        I need a way to display an html file, with the notion of page format - left margin, right margin, etc, which doesnt work properly with Textedit or textbrowser unless Im mistaken.
        Also I need it to work on mobile so apparently I cant use WebEngineCore which only is supported on desktop , and I think I'm left with QWebView ? But isn't it for QML Qt Quick only while Im on Qt c++.

        Any advice please ?

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #2

        @Brad1111 QWebEngineView is for Widgets. And you can mix widgets and qml items as well.

        B 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @Brad1111 QWebEngineView is for Widgets. And you can mix widgets and qml items as well.

          B Offline
          B Offline
          Brad1111
          wrote on last edited by
          #3

          @JoeCFD None of the QWebEngine functionalities are supported on mobile - Android/iOS - Or am I wrong ?
          I assume that leaves me with the only option left, that is to mix qml with widgets .. which I have no idea how to do -_-''
          Please kindly confirm that I cant use QWebEngineWidgets on mobile and I'll mark your message as solution. I'll have to read how to mix these things
          Thank you

          JoeCFDJ 1 Reply Last reply
          0
          • B Brad1111

            @JoeCFD None of the QWebEngine functionalities are supported on mobile - Android/iOS - Or am I wrong ?
            I assume that leaves me with the only option left, that is to mix qml with widgets .. which I have no idea how to do -_-''
            Please kindly confirm that I cant use QWebEngineWidgets on mobile and I'll mark your message as solution. I'll have to read how to mix these things
            Thank you

            JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by JoeCFD
            #4

            @Brad1111 It seems that web engine is not supported on Android. To mix qml with widgets. You can use

            class VideoWidget : public QQuickWidget
            {
                Q_OBJECT 
            };
            
            in the construtor, add your qml to it
               QUrl qml_source( "qrc:path/***.qml" );
               setSource( qml_source );
            

            https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/quick/quickwidgets/quickwidget?h=6.8

            If you project is not too big, you can use qml only. I mixed them only in one project, but I prefer to make pure widgets or qml projects.

            B 1 Reply Last reply
            1
            • B Brad1111 has marked this topic as solved on
            • JoeCFDJ JoeCFD

              @Brad1111 It seems that web engine is not supported on Android. To mix qml with widgets. You can use

              class VideoWidget : public QQuickWidget
              {
                  Q_OBJECT 
              };
              
              in the construtor, add your qml to it
                 QUrl qml_source( "qrc:path/***.qml" );
                 setSource( qml_source );
              

              https://code.qt.io/cgit/qt/qtdeclarative.git/tree/examples/quick/quickwidgets/quickwidget?h=6.8

              If you project is not too big, you can use qml only. I mixed them only in one project, but I prefer to make pure widgets or qml projects.

              B Offline
              B Offline
              Brad1111
              wrote on last edited by
              #5

              @JoeCFD thank you

              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