HTML Content didn't show after deployment the app ?
-
HTML content don't show after deployment the app using the manual method or windeployqt
the app working good on qt creator in debug and release mode
but after deployment the HTML content Disappear as shown in images
using msvc2017 X64 , QwebengineView, QWebChannel.
the white area is the html page .
EDIT: I try to deploy qml app only from tamplets (QQuickapplication scroll) but the same behavior I think this is the problem but I can't solve it . -
HTML content don't show after deployment the app using the manual method or windeployqt
the app working good on qt creator in debug and release mode
but after deployment the HTML content Disappear as shown in images
using msvc2017 X64 , QwebengineView, QWebChannel.
the white area is the html page .
EDIT: I try to deploy qml app only from tamplets (QQuickapplication scroll) but the same behavior I think this is the problem but I can't solve it .@m-feki Where is the HTML content located? Do you use resource files?
-
@jsulm yes located in The resource files "qrc:/mapdisp.html" after that i move it to local host to be "http://localhost/qtlip/mapdisp.html"
and define the path in c++ and path it as a property to QMLconst QString initialUrl= "http://localhost/qtlip/mapdisp.html"; QQuickView *view = new QQuickView(); view->rootContext()->setContextProperty("initialUrl",initialUrl); //pass to qml QWidget *container = QWidget::createWindowContainer(view, this); container->setMinimumSize(1480, 900); container->setMaximumSize(1480, 900); container->setFocusPolicy(Qt::TabFocus); view->setSource(QUrl("qrc:/DisplayMap.qml")); ui->verticalLayout->addWidget(container);
QML CODE
WebEngineView { id: webview anchors.fill: parent //url : "qrc:/mapdisp.html" url: initialUrl webChannel: channel }
and it also work good on qt creator and disappear with deployment
-
@jsulm yes located in The resource files "qrc:/mapdisp.html" after that i move it to local host to be "http://localhost/qtlip/mapdisp.html"
and define the path in c++ and path it as a property to QMLconst QString initialUrl= "http://localhost/qtlip/mapdisp.html"; QQuickView *view = new QQuickView(); view->rootContext()->setContextProperty("initialUrl",initialUrl); //pass to qml QWidget *container = QWidget::createWindowContainer(view, this); container->setMinimumSize(1480, 900); container->setMaximumSize(1480, 900); container->setFocusPolicy(Qt::TabFocus); view->setSource(QUrl("qrc:/DisplayMap.qml")); ui->verticalLayout->addWidget(container);
QML CODE
WebEngineView { id: webview anchors.fill: parent //url : "qrc:/mapdisp.html" url: initialUrl webChannel: channel }
and it also work good on qt creator and disappear with deployment
@m-feki said in HTML Content didn't show after deployment the app ?:
The resource files "qrc:/mapdisp.html" after that i move it to local host to be "http://localhost/qtlip/mapdisp.html"
If you use http://localhost/ then the computer that runs the app must also run a web server.
Why not just use the
qrc:/mapdisp.html
as your URL?