From 38b9c4f327d2860c5d6e6d2cdbd671173a0d75c8 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 16 Sep 2020 10:34:53 +0200 Subject: Fix additional warnings from usage of deprecated APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace more QLibaryInfo::location with QLibraryInfo::path Replace old event accessors APIs, including relevant comments. Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f Reviewed-by: Tor Arne Vestbø Reviewed-by: Shawn Rutledge --- examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp | 4 ++-- .../rendercontrol_opengl/window_singlethreaded.cpp | 6 +++--- .../qmltooling/qmldbg_preview/qqmlpreviewfileloader.cpp | 6 +++--- src/qml/qml/qqmlapplicationengine.cpp | 2 +- src/quick/scenegraph/qsgcontextplugin.cpp | 2 +- src/quickwidgets/qquickwidget.cpp | 6 +++--- .../debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp | 2 +- .../qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp | 2 +- tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp | 6 +++--- .../qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp | 4 ++-- .../tst_qqmldebugtranslationservice.cpp | 2 +- .../qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp | 2 +- .../tst_qqmlenginedebuginspectorintegration.cpp | 2 +- tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp | 2 +- tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp | 10 +++++----- .../debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp | 2 +- tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 2 +- tests/auto/qml/qmlformat/tst_qmlformat.cpp | 2 +- tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp | 4 ++-- tests/auto/qml/qmllint/tst_qmllint.cpp | 4 ++-- tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp | 2 +- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 2 +- tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp | 2 +- tests/auto/qml/qqmlimport/tst_qqmlimport.cpp | 4 ++-- tests/auto/qml/qv4assembler/tst_qv4assembler.cpp | 2 +- tests/auto/quick/examples/tst_examples.cpp | 4 ++-- 26 files changed, 44 insertions(+), 44 deletions(-) diff --git a/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp b/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp index 884f7e3981..918698effe 100644 --- a/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp +++ b/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp @@ -175,13 +175,13 @@ void Window::exposeEvent(QExposeEvent *) void Window::mousePressEvent(QMouseEvent *e) { - QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers()); + QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); } void Window::mouseReleaseEvent(QMouseEvent *e) { - QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers()); + QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); } diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp index 8f3bfe77db..8316772d3c 100644 --- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp +++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp @@ -318,9 +318,9 @@ void WindowSingleThreaded::handleScreenChange() void WindowSingleThreaded::mousePressEvent(QMouseEvent *e) { - // Use the constructor taking localPos and screenPos. That puts localPos into the - // event's localPos and windowPos, and screenPos into the event's screenPos. This way - // the windowPos in e is ignored and is replaced by localPos. This is necessary + // Use the constructor taking position and globalPosition. That puts position into the + // event's position and scenePosition, and globalPosition into the event's globalPosition. This way + // the scenePosition in e is ignored and is replaced by position. This is necessary // because QQuickWindow thinks of itself as a top-level window always. QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); diff --git a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewfileloader.cpp b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewfileloader.cpp index acd19a6f73..9a3460b063 100644 --- a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewfileloader.cpp +++ b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewfileloader.cpp @@ -59,10 +59,10 @@ QQmlPreviewFileLoader::QQmlPreviewFileLoader(QQmlPreviewServiceImpl *service) : m_blacklist.blacklist("/etc"); for (int loc = QLibraryInfo::PrefixPath; loc < QLibraryInfo::TestsPath; ++loc) { - m_blacklist.blacklist(QLibraryInfo::location( + m_blacklist.blacklist(QLibraryInfo::path( static_cast(loc))); } - m_blacklist.blacklist(QLibraryInfo::location(QLibraryInfo::SettingsPath)); + m_blacklist.blacklist(QLibraryInfo::path(QLibraryInfo::SettingsPath)); static const QStandardPaths::StandardLocation blackListLocations[] = { QStandardPaths::DataLocation, @@ -81,7 +81,7 @@ QQmlPreviewFileLoader::QQmlPreviewFileLoader(QQmlPreviewServiceImpl *service) : m_blacklist.blacklist(location); } - m_blacklist.whitelist(QLibraryInfo::location(QLibraryInfo::TestsPath)); + m_blacklist.whitelist(QLibraryInfo::path(QLibraryInfo::TestsPath)); connect(this, &QQmlPreviewFileLoader::request, service, &QQmlPreviewServiceImpl::forwardRequest, Qt::DirectConnection); diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index f7b8750d76..d866301f84 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -76,7 +76,7 @@ void QQmlApplicationEnginePrivate::init() q->connect(q, SIGNAL(uiLanguageChanged()), q_func(), SLOT(_q_loadTranslations())); #if QT_CONFIG(translation) QTranslator* qtTranslator = new QTranslator(q); - if (qtTranslator->load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath), QLatin1String(".qm"))) + if (qtTranslator->load(QLocale(), QLatin1String("qt"), QLatin1String("_"), QLibraryInfo::path(QLibraryInfo::TranslationsPath), QLatin1String(".qm"))) QCoreApplication::installTranslator(qtTranslator); else delete qtTranslator; diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp index 025716c2a7..2956c8c438 100644 --- a/src/quick/scenegraph/qsgcontextplugin.cpp +++ b/src/quick/scenegraph/qsgcontextplugin.cpp @@ -176,7 +176,7 @@ QSGAdaptationBackendData *contextFactory() qWarning("Could not create scene graph context for backend '%s'" " - check that plugins are installed correctly in %s", qPrintable(requestedBackend), - qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath))); + qPrintable(QLibraryInfo::path(QLibraryInfo::PluginsPath))); } } #endif // library diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp index bb9157d0e7..ca8bdac801 100644 --- a/src/quickwidgets/qquickwidget.cpp +++ b/src/quickwidgets/qquickwidget.cpp @@ -1365,9 +1365,9 @@ void QQuickWidget::mouseMoveEvent(QMouseEvent *e) Q_QUICK_INPUT_PROFILE(QQuickProfiler::Mouse, QQuickProfiler::InputMouseMove, e->position().x(), e->position().y()); - // Put localPos into the event's localPos and windowPos, and screenPos into the - // event's screenPos. This way the windowPos in e is ignored and is replaced by - // localPos. This is necessary because QQuickWindow thinks of itself as a + // Put position into the event's position and scenePosition, and globalPosition into the + // event's globalPosition. This way the scenePosition in e is ignored and is replaced by + // position. This is necessary because QQuickWindow thinks of itself as a // top-level window always. QMouseEvent mappedEvent(e->type(), e->position(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers(), e->source()); diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index ec7ee15d34..4165e8d9b4 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -135,7 +135,7 @@ QList tst_QDebugMessageService::createClients() void tst_QDebugMessageService::retrieveDebugOutput() { - QCOMPARE(QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + QCOMPARE(QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml", QString(), testFile(QMLFILE), true), ConnectSuccess); QTRY_VERIFY(m_client->logBuffer.size() >= 2); diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index 37118f4bd0..a22ae6e7a0 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -103,7 +103,7 @@ void tst_QQmlDebuggingEnabler::qmlscene() QFETCH(QStringList, services); m_process = new QQmlDebugProcess( - QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_process->setMaximumBindErrors(1); m_process->start(QStringList() << QString::fromLatin1("-qmljsdebugger=connector:%1%2%3%4") diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index 91470e0651..dd201d1cfd 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -178,7 +178,7 @@ QQmlDebugTest::ConnectResult tst_QQmlDebugJS::init(bool qmlscene, const QString bool blockMode, bool restrictServices) { const QString executable = qmlscene - ? QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene" + ? QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene" : debugJsServerPath("qqmldebugjs"); return QQmlDebugTest::connectTo( executable, restrictServices ? QStringLiteral("V8Debugger") : QString(), @@ -471,7 +471,7 @@ void tst_QQmlDebugJS::setBreakpointInJavaScript() if (seedCache) { // Make sure there is a qmlc file that the engine should _not_ laod. QProcess process; - process.start(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", + process.start(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", { testFile(QUITINJS_QMLFILE) }); QTRY_COMPARE(process.state(), QProcess::NotRunning); } @@ -854,7 +854,7 @@ void tst_QQmlDebugJS::evaluateInContext() { m_connection = new QQmlDebugConnection(); m_process = new QQmlDebugProcess( - QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); + QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", this); m_client = new QV4DebugClient(m_connection); QScopedPointer engineClient(new QQmlEngineDebugClient(m_connection)); m_process->start(QStringList() << QLatin1String(BLOCKMODE) << testFile(ONCOMPLETED_QMLFILE)); diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp index 3557940386..7815987870 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp @@ -106,7 +106,7 @@ void tst_QQmlDebugService::checkPortRange() { QScopedPointer connection1(new QQmlDebugConnection()); QScopedPointer process1( - new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + new QQmlDebugProcess(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", this)); process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") @@ -123,7 +123,7 @@ void tst_QQmlDebugService::checkPortRange() // Second instance QScopedPointer connection2(new QQmlDebugConnection()); QScopedPointer process2( - new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + new QQmlDebugProcess(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", this)); process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp index 01ee805dee..fcff640657 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp @@ -66,7 +66,7 @@ QList tst_QQmlDebugTranslationService::createClients() void tst_QQmlDebugTranslationService::pluginConnection() { - auto executable = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml"; + auto executable = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml"; auto services = "DebugTranslation"; auto extraArgs = testFile(QMLFILE); auto block = true; diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp index c8915fb840..05abab737e 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp +++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp @@ -82,7 +82,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlEngineControl::connectTo(const QString &file, bool restrictServices) { - return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", + return QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene", restrictServices ? QStringLiteral("EngineControl") : QString(), testFile(file), true); } diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 9830f1a9bd..34c6faf4ae 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -88,7 +88,7 @@ QQmlEngineDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRoot QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices) { return QQmlDebugTest::connectTo( - QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml", restrictServices ? QStringLiteral("QmlDebugger,QmlInspector") : QString(), testFile("qtquick2.qml"), true); } diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index b5f45f1eeb..1c72242703 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -64,7 +64,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlInspector::startQmlProcess(const QString &qmlFile, bool restrictServices) { - return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + return QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml", restrictServices ? QStringLiteral("QmlInspector") : QString(), testFile(qmlFile), true); } diff --git a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp index eb6ee09479..41b52a0a6b 100644 --- a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp +++ b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp @@ -74,7 +74,7 @@ private slots: QQmlDebugTest::ConnectResult tst_QQmlPreview::startQmlProcess(const QString &qmlFile) { - return QQmlDebugTest::connectTo(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qml", + return QQmlDebugTest::connectTo(QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml", QStringLiteral("QmlPreview"), testFile(qmlFile), true); } @@ -245,18 +245,18 @@ void tst_QQmlPreview::blacklist() blacklist2.blacklist(":/qt-project.org"); blacklist2.blacklist(":/QtQuick/Controls/Styles"); blacklist2.blacklist(":/ExtrasImports/QtQuick/Controls/Styles"); - blacklist2.blacklist(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)); + blacklist2.blacklist(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath)); blacklist2.blacklist("/home/ulf/.local/share/QtProject/Qml Runtime/configuration.qml"); blacklist2.blacklist("/usr/share"); blacklist2.blacklist("/usr/share/QtProject/Qml Runtime/configuration.qml"); - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath))); + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath))); blacklist2.blacklist("/usr/local/share/QtProject/Qml Runtime/configuration.qml"); blacklist2.blacklist("qml"); blacklist2.blacklist(""); // This should not remove all other paths. - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) + + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath) + "/QtQuick/Window.2.0")); - QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath))); + QVERIFY(blacklist2.isBlacklisted(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath))); QVERIFY(blacklist2.isBlacklisted("/usr/share/QtProject/Qml Runtime/configuration.qml")); QVERIFY(blacklist2.isBlacklisted("/usr/share/stuff")); QVERIFY(blacklist2.isBlacklisted("")); diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index e7d6664136..f248b1ae90 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -204,7 +204,7 @@ private: ConnectResult connectTo(bool block, const QString &file, bool recordFromStart = true, uint flushInterval = 0, bool restrictServices = true, const QString &executable - = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); + = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmlscene"); void checkProcessTerminated(); void checkTraceReceived(); void checkJsHeap(); diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 283aef9317..bc6451dac0 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -106,7 +106,7 @@ static bool generateCache(const QString &qmlFileName, QByteArray *capturedStderr QProcess proc; if (capturedStderr == nullptr) proc.setProcessChannelMode(QProcess::ForwardedChannels); - proc.setProgram(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator() + QLatin1String("qmlcachegen")); + proc.setProgram(QLibraryInfo::path(QLibraryInfo::BinariesPath) + QDir::separator() + QLatin1String("qmlcachegen")); proc.setArguments(QStringList() << qmlFileName); proc.start(); if (!proc.waitForFinished()) diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index ad1d33336d..c1c248e413 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -66,7 +66,7 @@ private: void TestQmlformat::initTestCase() { QQmlDataTest::initTestCase(); - m_qmlformatPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlformat"); + m_qmlformatPath = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/qmlformat"); #ifdef Q_OS_WIN m_qmlformatPath += QLatin1String(".exe"); #endif diff --git a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp index f4df7e9ac6..6e06623fa6 100644 --- a/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp +++ b/tests/auto/qml/qmlimportscanner/tst_qmlimportscanner.cpp @@ -55,7 +55,7 @@ private: void TestQmlimportscanner::initTestCase() { QQmlDataTest::initTestCase(); - m_qmlimportscannerPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmlimportscanner"); + m_qmlimportscannerPath = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/qmlimportscanner"); #ifdef Q_OS_WIN m_qmlimportscannerPath += QLatin1String(".exe"); #endif @@ -121,7 +121,7 @@ void TestQmlimportscanner::runQmlimportscanner(const QString &mode, const QStrin const QString file(pathToScan); QStringList args { mode, file, - "-importPath", QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath), dataDirectory() + "-importPath", QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath), dataDirectory() }; QString errors; QProcess process; diff --git a/tests/auto/qml/qmllint/tst_qmllint.cpp b/tests/auto/qml/qmllint/tst_qmllint.cpp index 02740e7ecf..74f73d8baf 100644 --- a/tests/auto/qml/qmllint/tst_qmllint.cpp +++ b/tests/auto/qml/qmllint/tst_qmllint.cpp @@ -61,7 +61,7 @@ private: void TestQmllint::initTestCase() { QQmlDataTest::initTestCase(); - m_qmllintPath = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmllint"); + m_qmllintPath = QLibraryInfo::path(QLibraryInfo::BinariesPath) + QLatin1String("/qmllint"); #ifdef Q_OS_WIN m_qmllintPath += QLatin1String(".exe"); #endif @@ -247,7 +247,7 @@ void TestQmllint::cleanQmlCode() QString TestQmllint::runQmllint(const QString &fileToLint, bool shouldSucceed, const QStringList &extraArgs) { - auto qmlImportDir = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); + auto qmlImportDir = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); QStringList args; args << testFile(fileToLint) << QStringLiteral("-I") << qmlImportDir diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp index 72356a4d84..295f2a31e3 100644 --- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp +++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp @@ -62,7 +62,7 @@ tst_qmlplugindump::tst_qmlplugindump() void tst_qmlplugindump::initTestCase() { QQmlDataTest::initTestCase(); - qmlplugindumpPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + qmlplugindumpPath = QLibraryInfo::path(QLibraryInfo::BinariesPath); #if defined(Q_OS_WIN) qmlplugindumpPath += QLatin1String("/qmlplugindump.exe"); diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 77d4783f56..c37d2b0990 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -9113,7 +9113,7 @@ void tst_qqmlecmascript::hugeStack() void tst_qqmlecmascript::gcCrashRegressionTest() { - const QString qmljs = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmljs"; + const QString qmljs = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmljs"; if (!QFile::exists(qmljs)) { QSKIP("Tets requires qmljs"); } diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp index 16b8fe578d..c9fe00a837 100644 --- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp +++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp @@ -76,7 +76,7 @@ private Q_SLOTS: void tst_qqmlextensionplugin::iidCheck_data() { QList files; - for (QDirIterator it(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath), QDirIterator::Subdirectories); it.hasNext(); ) { + for (QDirIterator it(QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath), QDirIterator::Subdirectories); it.hasNext(); ) { QString file = it.next(); #if defined(Q_OS_DARWIN) if (file.contains(QLatin1String(".dSYM/"))) diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp index 03a046db8b..8229b79702 100644 --- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp +++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp @@ -166,11 +166,11 @@ void tst_QQmlImport::uiFormatLoading() void tst_QQmlImport::importPathOrder() { #ifdef Q_OS_ANDROID - QSKIP("QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) returns bogus path on Android, but its nevertheless unusable."); + QSKIP("QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath) returns bogus path on Android, but its nevertheless unusable."); #endif QStringList expectedImportPaths; QString appDirPath = QCoreApplication::applicationDirPath(); - QString qml2Imports = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); + QString qml2Imports = QLibraryInfo::path(QLibraryInfo::Qml2ImportsPath); #ifdef Q_OS_WIN // The drive letter has a different case as QQmlImport will // cause it to be converted after passing through QUrl diff --git a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp index 5dd8e9dcc0..0e8cedb20b 100644 --- a/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp +++ b/tests/auto/qml/qv4assembler/tst_qv4assembler.cpp @@ -62,7 +62,7 @@ void tst_QV4Assembler::perfMapFile() #if !defined(Q_OS_LINUX) || defined(Q_OS_ANDROID) QSKIP("perf map files are only generated on linux"); #else - const QString qmljs = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmljs"; + const QString qmljs = QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qmljs"; QProcess process; QTemporaryFile infile; diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp index 4cec3719e4..dca5c1c3fd 100644 --- a/tests/auto/quick/examples/tst_examples.cpp +++ b/tests/auto/quick/examples/tst_examples.cpp @@ -167,8 +167,8 @@ void tst_examples::namingConvention(const QDir &d) void tst_examples::namingConvention() { QStringList examplesLocations; - examplesLocations << QLibraryInfo::location(QLibraryInfo::ExamplesPath) + QLatin1String("/qml"); - examplesLocations << QLibraryInfo::location(QLibraryInfo::ExamplesPath) + QLatin1String("/quick"); + examplesLocations << QLibraryInfo::path(QLibraryInfo::ExamplesPath) + QLatin1String("/qml"); + examplesLocations << QLibraryInfo::path(QLibraryInfo::ExamplesPath) + QLatin1String("/quick"); foreach(const QString &examples, examplesLocations) { QDir d(examples); -- cgit v1.2.3