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 276 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 27 Jan 2025, 23:28 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 ?

    J 1 Reply Last reply 27 Jan 2025, 23:37
    0
    • B Brad1111
      27 Jan 2025, 23:54

      @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

      J Offline
      J Offline
      JoeCFD
      wrote on 29 Jan 2025, 12:30 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 29 Jan 2025, 14:07
      1
      • B Brad1111
        27 Jan 2025, 23:28

        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 ?

        J Offline
        J Offline
        JoeCFD
        wrote on 27 Jan 2025, 23:37 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 27 Jan 2025, 23:54
        0
        • J JoeCFD
          27 Jan 2025, 23:37

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

          B Offline
          B Offline
          Brad1111
          wrote on 27 Jan 2025, 23:54 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

          J 1 Reply Last reply 29 Jan 2025, 12:30
          0
          • B Brad1111
            27 Jan 2025, 23:54

            @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

            J Offline
            J Offline
            JoeCFD
            wrote on 29 Jan 2025, 12:30 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 29 Jan 2025, 14:07
            1
            • B Brad1111 has marked this topic as solved on 29 Jan 2025, 13:57
            • J JoeCFD
              29 Jan 2025, 12:30

              @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 29 Jan 2025, 14:07 last edited by
              #5

              @JoeCFD thank you

              1 Reply Last reply
              0

              1/5

              27 Jan 2025, 23:28

              • Login

              • Login or register to search.
              1 out of 5
              • First post
                1/5
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved