QtWebEngineProcess not in application directory(.\utils\QtWebEngineProcess.exe) makes QWebEngineView no rendering
-
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
-
@fisher103
You seem to be using Windows. I have no idea, but why would you assume theQTWEBENGINEPROCESS_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....