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. QtWebEngineProcess not in application directory(.\utils\QtWebEngineProcess.exe) makes QWebEngineView no rendering
Forum Updated to NodeBB v4.3 + New Features

QtWebEngineProcess not in application directory(.\utils\QtWebEngineProcess.exe) makes QWebEngineView no rendering

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • F Offline
    F Offline
    fisher103
    wrote on last edited by
    #1

    As the topic says, QWebEngineView can be show but rendering nothing if set QtWebEngineProcess path in app sub-directory.
    code like this:

    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QString libPath = QString("%1/%2").arg(app.applicationDirPath(), "utils");
        qputenv("QTWEBENGINEPROCESS_PATH", libPath.toLocal8Bit());
        ...
    }
    

    copy the QtWebEngineProcess.exe to sub-directory, when app starts, console output:

    [15128:17412:0921/172513.395:ERROR:child_process_launcher.cc(522)] Failed to launch child process
    

    Of course, every thing works fine if make no change to QTWEBENGINEPROCESS_PATH (use default).

    Environment: windows10 with Qt5.9.5-msvc2015

    JonBJ 1 Reply Last reply
    0
    • JonBJ JonB

      @fisher103
      You seem to be using Windows. I have no idea, but why would you assume the QTWEBENGINEPROCESS_PATH environment variable would would work with /s in it. Did you at least try with a \ instead?

      Also you would need to ensure any further DLLs required by it are in that sub-directory if they are not on your PATH?

      • Test by trying to just execute it from a command prompt, see what error you get?

      EDIT You only set the variable to the directory, not the executable. Show what documentation you used which stated to do this? The only reference I find is in https://bugreports.qt.io/browse/QTBUG-41599, where one poster states:

      As a workaround for now, please set the QTWEBENGINEPROCESS_PATH environment variable to the absolute path of QtWebEngineProcess.exe (including the .exe file)

      So maybe it needs to be the full path to the .exe not just the directory?

      Hmmm, https://code.woboq.org/qt5/qtwebengine/src/core/web_engine_library_info.cpp.html, maybe not:

      155 const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); 
      156 if (!fromEnv.isEmpty()) { 
      157         // Only search in QTWEBENGINEPROCESS_PATH if set 
      158         candidatePaths << QString::fromLocal8Bit(fromEnv); 
      

      But I find another post (https://riverbankcomputing.com/pipermail/pyqt/2016-April/037401.html) where suggested you try full path to executable. I think that's wrong from the code but you'd better try it out to make sure....

      F Offline
      F Offline
      fisher103
      wrote on last edited by
      #3

      @JonB set the QTWEBENGINEPROCESS_PATH environment variable to the absolute path of QtWebEngineProcess.exe (including the .exe file) works now. Qt official Doc I used makes no detail about this.

      1 Reply Last reply
      0
      • F fisher103

        As the topic says, QWebEngineView can be show but rendering nothing if set QtWebEngineProcess path in app sub-directory.
        code like this:

        int main(int argc, char *argv[])
        {
            QApplication app(argc, argv);
        
            QString libPath = QString("%1/%2").arg(app.applicationDirPath(), "utils");
            qputenv("QTWEBENGINEPROCESS_PATH", libPath.toLocal8Bit());
            ...
        }
        

        copy the QtWebEngineProcess.exe to sub-directory, when app starts, console output:

        [15128:17412:0921/172513.395:ERROR:child_process_launcher.cc(522)] Failed to launch child process
        

        Of course, every thing works fine if make no change to QTWEBENGINEPROCESS_PATH (use default).

        Environment: windows10 with Qt5.9.5-msvc2015

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @fisher103
        You seem to be using Windows. I have no idea, but why would you assume the QTWEBENGINEPROCESS_PATH environment variable would would work with /s in it. Did you at least try with a \ instead?

        Also you would need to ensure any further DLLs required by it are in that sub-directory if they are not on your PATH?

        • Test by trying to just execute it from a command prompt, see what error you get?

        EDIT You only set the variable to the directory, not the executable. Show what documentation you used which stated to do this? The only reference I find is in https://bugreports.qt.io/browse/QTBUG-41599, where one poster states:

        As a workaround for now, please set the QTWEBENGINEPROCESS_PATH environment variable to the absolute path of QtWebEngineProcess.exe (including the .exe file)

        So maybe it needs to be the full path to the .exe not just the directory?

        Hmmm, https://code.woboq.org/qt5/qtwebengine/src/core/web_engine_library_info.cpp.html, maybe not:

        155 const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); 
        156 if (!fromEnv.isEmpty()) { 
        157         // Only search in QTWEBENGINEPROCESS_PATH if set 
        158         candidatePaths << QString::fromLocal8Bit(fromEnv); 
        

        But I find another post (https://riverbankcomputing.com/pipermail/pyqt/2016-April/037401.html) where suggested you try full path to executable. I think that's wrong from the code but you'd better try it out to make sure....

        F 1 Reply Last reply
        0
        • JonBJ JonB

          @fisher103
          You seem to be using Windows. I have no idea, but why would you assume the QTWEBENGINEPROCESS_PATH environment variable would would work with /s in it. Did you at least try with a \ instead?

          Also you would need to ensure any further DLLs required by it are in that sub-directory if they are not on your PATH?

          • Test by trying to just execute it from a command prompt, see what error you get?

          EDIT You only set the variable to the directory, not the executable. Show what documentation you used which stated to do this? The only reference I find is in https://bugreports.qt.io/browse/QTBUG-41599, where one poster states:

          As a workaround for now, please set the QTWEBENGINEPROCESS_PATH environment variable to the absolute path of QtWebEngineProcess.exe (including the .exe file)

          So maybe it needs to be the full path to the .exe not just the directory?

          Hmmm, https://code.woboq.org/qt5/qtwebengine/src/core/web_engine_library_info.cpp.html, maybe not:

          155 const QByteArray fromEnv = qgetenv("QTWEBENGINEPROCESS_PATH"); 
          156 if (!fromEnv.isEmpty()) { 
          157         // Only search in QTWEBENGINEPROCESS_PATH if set 
          158         candidatePaths << QString::fromLocal8Bit(fromEnv); 
          

          But I find another post (https://riverbankcomputing.com/pipermail/pyqt/2016-April/037401.html) where suggested you try full path to executable. I think that's wrong from the code but you'd better try it out to make sure....

          F Offline
          F Offline
          fisher103
          wrote on last edited by
          #3

          @JonB set the QTWEBENGINEPROCESS_PATH environment variable to the absolute path of QtWebEngineProcess.exe (including the .exe file) works now. Qt official Doc I used makes no detail about this.

          1 Reply Last reply
          0

          • Login

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