Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Differences: QDesktopServices vs QStandardPaths

$
0
0
Can anyone tell me if the following differences between the paths returned by Qt 4.8 QDesktopServices and 5.1RC QStandardPaths are intentional or bug-worthy? (They are certainly annoying either way) #include <QtCore> #include <QDesktopServices>   int main(int argc, char **argv) {     QCoreApplication app(argc, argv);     app.setOrganizationName("ExampleOrg");     app.setOrganizationDomain("example.com.au");     app.setApplicationName("ExampleApp"); #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)     QStringList paths = QStandardPaths::standardLocations(QStandardPaths::DataLocation); #else     QString paths = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif     qDebug() << qVersion() << paths;     return 0; } Outputs under different Qt versions on 64-bit Linux: 4.8.4  "/home/chrisw/.local/share/data/ExampleOrg/ExampleApp" 5.1.0 ("/home/chrisw/.local/share/ExampleOrg/ExampleApp", "/usr/share/ExampleOrg/ExampleApp", "/usr/local/share/ExampleOrg/ExampleApp", "/usr/share/ExampleOrg/ExampleApp") Note the extra “data” directory in the Qt4 path. This means my ported Qt4-based code, when built with Qt5, looks in the wrong location for data that was previously installed/generated in the DataLocation on the deployed machine.

Viewing all articles
Browse latest Browse all 13965

Trending Articles