Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.11, 6.2.6, 6.4.1
-
ddfe36393 (dev), db2fb1c26 (6.4), a03a658bb (6.5)
Description
The examples use relative paths to navigate from the executable's directory back to the source directory. These paths are only correct for in-source builds, not for shadow builds.
- The OPC UA Viewer example (https://doc.qt.io/qt-6/qtopcua-opcuaviewer-example.html ) tries to load and save certificates in the source folder
- The Water Pump examples (https://doc.qt.io/qt-6/qtopcua-waterpump-waterpump-qmlcpp-example.html, https://doc.qt.io/qt-6/qtopcua-waterpump-waterpump-qml-example.html ) try to launch the Simulation Server executable via a relative path.
In addition, the Windows-specific path building code in the OPC UA Viewer Example is wrong anyway:
Critical: Creating PKI path 'C:/Qt/Examples/Qt-6.4.1/opcua/build-opcuaviewer-Desktop_Qt_6_4_1_MSVC2019_64bit-Debug..//pki/trusted/certs': FAILED.
Suggestions
- Embed provided certificates in a QRC resource, to avoid loading them from the source folder.
- Save certificates somewhere using QStandardPaths or in PWD, to avoid writing files to the source folder.
- Just ask the user to manually run the Simulation Server before starting the client (like how the WebSocket examples do it: https://doc.qt.io/qt-6/qtwebsockets-examples.html ). Don't try to be programatically find the other executable.
Attachments
Issue Links
- relates to
-
QTBUG-109096 Installed version of OPC UA example cannot compile because it relies on the presence of Qt source code
-
- Closed
-