Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.0, 6.5, 6.9
-
None
Description
QGenericUnixServices::openUrl() calls xdg-open.
In a KDE environment this ends up in kde-open, which depends on Qt.
QDesktopServices::openUrl() fails, when
- called from an App that has been compiled against a more recent Qt version than kde-open, and
- the app sets LD_LIBRARY_PATH to point at the (newer) Qt version against which it was built.
The reason is that xdg-open is called by the static QProcess::startDetached(), which inherits the application's process environment. That makes no sense. A desktop service should be called with LD_LIBRARY_PATH unset.
That can be easily reproduced, by adding the following to tst_qdesktopservices::openUrl():
const QUrl url("https://www.qt.io"); QCOMPARE(QDesktopServices::openUrl(url), true);
The website will not be launched. Instead, the following error message will appear (on openSuSE 15.6):
kde-open: /home/axel/QtGit/toplevel/build/dev/qtbase/lib/libQt6Gui.so.6: version `Qt_6.8.1_PRIVATE_API' not found (required by /lib64/libKF6WindowSystem.so.6)
The test will pass anyhow, because kde-open will write it to std::err, after QDesktopServices::openUrl() has returned true.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-132448 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
614927,4 | Add tst_openurl in qthttpserver submodule | dev | qt/qthttpserver | Status: NEW | 0 | -1 |
613769,4 | QGenericUnixServices::openUrl(): launch with LD_LIBRARY_PATH unset | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |