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. Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer

Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 478 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.
  • M MyNameIsQt

    @Axel-Spoerl I can create an installer.exe using Inno Setup Compiler. However, the HTML, which is the main component of the application, is not displaying. I can't find Qt6WebEngine, is it no longer in use? How can I resolve the issue of the HTML not displaying?

    The following DLLs are present:

    Qt6Core.dll
    Qt6Gui.dll
    Qt6Network.dll
    Qt6OpenGl.dll
    Qt6Positioning.dll
    Qt6Qml.dll
    QmlModels.dll
    QmlWorkerScript.dll
    Quick.dll
    Quick3DUtils.dll
    QuickWidgets.dll
    Qt6SerialPort.dll
    Qt6Svg.dll
    Qt6VirtualKeyboard.dll
    Qt6WebChannel.dll
    Qt6WebEngineCore.dll
    Qt6WebEngineWidgets.dll
    Qt6Widgets.dll
    QtWebEngineProcess.exe

    Thanks a lot.

    SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    @MyNameIsQt hi,

    Did you run windeployqt before packing things with innosetup ?

    These dlls alone are not all. There are plugins, QML files, etc.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    M 2 Replies Last reply
    0
    • SGaistS SGaist

      @MyNameIsQt hi,

      Did you run windeployqt before packing things with innosetup ?

      These dlls alone are not all. There are plugins, QML files, etc.

      M Offline
      M Offline
      MyNameIsQt
      wrote on last edited by
      #5
      This post is deleted!
      1 Reply Last reply
      0
      • SGaistS SGaist

        @MyNameIsQt hi,

        Did you run windeployqt before packing things with innosetup ?

        These dlls alone are not all. There are plugins, QML files, etc.

        M Offline
        M Offline
        MyNameIsQt
        wrote on last edited by
        #6

        @SGaist Yes, I ran windeployqt using Qt 6.8.2 (MSVC 2022 64-bit) before packaging the application.

        I used windeployqt to deploy the necessary Qt libraries, plugins, QML files, and other dependencies required for the application to run correctly on the target system. This ensures that all the essential files are included for proper execution.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #7

          To clear thing up: are you able to start the application properly from the explorer once you have run windeployqt ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 2 Replies Last reply
          0
          • SGaistS SGaist

            To clear thing up: are you able to start the application properly from the explorer once you have run windeployqt ?

            M Offline
            M Offline
            MyNameIsQt
            wrote on last edited by
            #8

            @SGaist No, after running windeployqt, the application does not display the HTML content. However, other functionalities, such as opening and saving files, seem to work fine.

            1 Reply Last reply
            0
            • SGaistS SGaist

              To clear thing up: are you able to start the application properly from the explorer once you have run windeployqt ?

              M Offline
              M Offline
              MyNameIsQt
              wrote on last edited by
              #9

              @SGaist Could this issue be caused by a missing Qt6WebEngine.dll? The HTML is not displaying, and I'm wondering if it’s due to the absence of this file.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #10

                Where are you loading your html from ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                M 1 Reply Last reply
                0
                • SGaistS SGaist

                  Where are you loading your html from ?

                  M Offline
                  M Offline
                  MyNameIsQt
                  wrote on last edited by MyNameIsQt
                  #11

                  @SGaist
                  What does it mean? Do you mean this?

                  #include <QWebEngineSettings>
                  #include <QWebEngineProfile>
                  #include <QWebEnginePage>
                  
                  MyViewApplication::MyViewApplication(QWidget *parent)
                      : QMainWindow(parent)
                      , ui(new Ui::MyViewApplication)
                      , styleSheet()
                      , windowSizeLabel(nullptr)
                      , m_isCanvasLoaded(false)
                      , webView(new QWebEngineView(this))
                      , channel(new QWebChannel(this))
                      , channelManager(new ChannelManager(this))  
                  {
                      setMinimumSize(960, 640);
                  
                      //setMinimumSize(960, 640);
                      ui->setupUi(this);
                      setCentralWidget(webView);
                  
                      QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
                      profile->setCachePath("C:/Users/user/Documents/Cache"); 
                      profile->setPersistentStoragePath("C:/Users/user/Documents/indexedDB"); 
                  
                      webView->setPage(new QWebEnginePage(profile, webView));
                  
                      webView->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
                      webView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
                      webView->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
                      webView->page()->setDevToolsPage(new QWebEnginePage(this));
                  
                      QString htmlPath = QFileInfo(__FILE__).dir().absolutePath() + "/main.html";
                      QFile file(htmlPath);
                      if (file.exists()) {
                          webView->load(QUrl::fromLocalFile(htmlPath));
                      } else {
                          qDebug() << "Failed to load main.html. File not found.";
                      }
                  
                      webView->page()->setWebChannel(channelManager->getChannel());
                      channelManager->registerObject("MyViewApplication", this);
                  
                      createStatusBar();
                      initResources();
                      showMaximized();
                  
                      QAction *openDevToolsAction = new QAction("Open DevTools", this);
                      connect(openDevToolsAction, &QAction::triggered, this, [this]() {
                  
                          QWebEngineView *devToolsView = new QWebEngineView();
                  
                          devToolsView->setPage(webView->page()->devToolsPage());
                  
                          devToolsView->resize(800, 600); 
                          devToolsView->show();
                      });
                      addAction(openDevToolsAction);
                      openDevToolsAction->setShortcut(QKeySequence("F12"));
                  }
                  
                  

                  main.cpp

                  #include "MyViewApplication.h"
                  
                  #include <QApplication>
                  
                  int main(int argc, char *argv[])
                  {
                      QApplication a(argc, argv);
                      MyViewApplication w;
                      w.show();
                      return a.exec();
                  }
                  
                  
                  jsulmJ 1 Reply Last reply
                  0
                  • M MyNameIsQt

                    @SGaist
                    What does it mean? Do you mean this?

                    #include <QWebEngineSettings>
                    #include <QWebEngineProfile>
                    #include <QWebEnginePage>
                    
                    MyViewApplication::MyViewApplication(QWidget *parent)
                        : QMainWindow(parent)
                        , ui(new Ui::MyViewApplication)
                        , styleSheet()
                        , windowSizeLabel(nullptr)
                        , m_isCanvasLoaded(false)
                        , webView(new QWebEngineView(this))
                        , channel(new QWebChannel(this))
                        , channelManager(new ChannelManager(this))  
                    {
                        setMinimumSize(960, 640);
                    
                        //setMinimumSize(960, 640);
                        ui->setupUi(this);
                        setCentralWidget(webView);
                    
                        QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
                        profile->setCachePath("C:/Users/user/Documents/Cache"); 
                        profile->setPersistentStoragePath("C:/Users/user/Documents/indexedDB"); 
                    
                        webView->setPage(new QWebEnginePage(profile, webView));
                    
                        webView->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
                        webView->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
                        webView->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
                        webView->page()->setDevToolsPage(new QWebEnginePage(this));
                    
                        QString htmlPath = QFileInfo(__FILE__).dir().absolutePath() + "/main.html";
                        QFile file(htmlPath);
                        if (file.exists()) {
                            webView->load(QUrl::fromLocalFile(htmlPath));
                        } else {
                            qDebug() << "Failed to load main.html. File not found.";
                        }
                    
                        webView->page()->setWebChannel(channelManager->getChannel());
                        channelManager->registerObject("MyViewApplication", this);
                    
                        createStatusBar();
                        initResources();
                        showMaximized();
                    
                        QAction *openDevToolsAction = new QAction("Open DevTools", this);
                        connect(openDevToolsAction, &QAction::triggered, this, [this]() {
                    
                            QWebEngineView *devToolsView = new QWebEngineView();
                    
                            devToolsView->setPage(webView->page()->devToolsPage());
                    
                            devToolsView->resize(800, 600); 
                            devToolsView->show();
                        });
                        addAction(openDevToolsAction);
                        openDevToolsAction->setShortcut(QKeySequence("F12"));
                    }
                    
                    

                    main.cpp

                    #include "MyViewApplication.h"
                    
                    #include <QApplication>
                    
                    int main(int argc, char *argv[])
                    {
                        QApplication a(argc, argv);
                        MyViewApplication w;
                        w.show();
                        return a.exec();
                    }
                    
                    
                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #12

                    @MyNameIsQt said in Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer:

                    QString htmlPath = QFileInfo(FILE).dir().absolutePath() + "/main.html";

                    How is this going to work?!
                    Either put the HTML file into a recourse file or deploy the HTML file together with the application and construct correct path at runtime using https://doc.qt.io/qt-6/qstandardpaths.html#locate

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

                    M 1 Reply Last reply
                    1
                    • jsulmJ jsulm

                      @MyNameIsQt said in Issue with Qt WebEngine, Missing DLLs, and Creating EXE Installer:

                      QString htmlPath = QFileInfo(FILE).dir().absolutePath() + "/main.html";

                      How is this going to work?!
                      Either put the HTML file into a recourse file or deploy the HTML file together with the application and construct correct path at runtime using https://doc.qt.io/qt-6/qstandardpaths.html#locate

                      M Offline
                      M Offline
                      MyNameIsQt
                      wrote on last edited by
                      #13

                      @jsulm Thanks to you, the problem was solved.

                      1 Reply Last reply
                      0
                      • M MyNameIsQt has marked this topic as solved on

                      • Login

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