display Html file in QT C++ with Webview ?
-
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 ?
-
@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.
-
@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 -
@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.
-