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. HTML Content didn't show after deployment the app ?
Forum Updated to NodeBB v4.3 + New Features

HTML Content didn't show after deployment the app ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 439 Views 1 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.
  • M Offline
    M Offline
    m.feki
    wrote on last edited by m.feki
    #1

    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 .

    in qt creator  releasw mode
    after deployment
    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 .

    jsulmJ 1 Reply Last reply
    0
    • M m.feki

      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 .

      in qt creator  releasw mode
      after deployment
      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 .

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @m-feki Where is the HTML content located? Do you use resource files?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @m-feki Where is the HTML content located? Do you use resource files?

        M Offline
        M Offline
        m.feki
        wrote on last edited by
        #3

        @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 QML

        const 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

        JKSHJ 1 Reply Last reply
        0
        • M m.feki

          @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 QML

          const 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

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @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?

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          2

          • Login

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