aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-08-03 11:54:48 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-05 14:13:13 +0000
commitd3b71088d7385bac527fdafb9a15f3e4b0ad5394 (patch)
tree8cf5d45826edf8552c5a75615fc1ec4632ea665c
parentab96456f8d86aeb60b51dde4f4fe419b0156c9b2 (diff)
Replace uses of deprecated QWARN macro with qWarning
Change-Id: I15de3c79d6a358f3b57cb5750d684f045bc97c3f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit d4288b238df8ba65b95f48da245350e77407fff8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qmltest/TestCase.qml2
-rw-r--r--src/qmltest/quicktestevent.cpp2
-rw-r--r--tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp6
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp12
4 files changed, 9 insertions, 13 deletions
diff --git a/src/qmltest/TestCase.qml b/src/qmltest/TestCase.qml
index 1c9011e01e..5a2cd1d5c4 100644
--- a/src/qmltest/TestCase.qml
+++ b/src/qmltest/TestCase.qml
@@ -1133,7 +1133,7 @@ Item {
\qmlmethod TestCase::warn(message)
Prints \a message as a warning message. Similar to
- \c{QWARN(message)} in C++.
+ \c{qWarning(message)} in C++.
\sa ignoreWarning()
*/
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 1ed642fe07..a0ceb7706f 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -227,7 +227,7 @@ namespace QtQuickTest
static const char *mouseActionNames[] =
{ "MousePress", "MouseRelease", "MouseClick", "MouseDoubleClick", "MouseMove", "MouseDoubleClickSequence" };
QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving window");
- QWARN(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toLatin1().data());
+ QTest::qWarn(warning.arg(QString::fromLatin1(mouseActionNames[static_cast<int>(action)])).toLatin1().data());
}
}
diff --git a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp
index ca348eea03..46f3c49d86 100644
--- a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp
+++ b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp
@@ -92,8 +92,8 @@ void tst_PropertyRequirements::constantOrNotifyableMain()
}
messages.sort();
- const QString message("\nThe following QML Types have properties which are neither CONSTANT nor NOTIFYable:\n");
- QWARN(qPrintable(message + messages.join("\n")));
+ qWarning() << "\nThe following QML Types have properties which are neither CONSTANT nor NOTIFYable:\n"
+ << qPrintable(messages.join("\n"));
// TODO enable once technical debt is fixes
// QCOMPARE(failuresByProperty.count(), 0);
@@ -127,7 +127,7 @@ void tst_PropertyRequirements::constantOrNotifyableFull()
}
messages.sort();
- QWARN(qPrintable(messages.join("\n")));
+ qWarning() << qPrintable(messages.join("\n"));
// TODO enable once technical debt is fixes
// QCOMPARE(failuresByProperty.count(), 0);
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 1a04d317ce..3369435bce 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -2123,18 +2123,14 @@ void tst_qquickwindow::requestActivate()
{
QMouseEvent me(QEvent::MouseButtonPress, pos, window1->mapToGlobal(pos), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
QSpontaneKeyEvent::setSpontaneous(&me);
- if (!qApp->notify(window1.data(), &me)) {
- QString warning = QString::fromLatin1("Mouse event MousePress not accepted by receiving window");
- QWARN(warning.toLatin1().data());
- }
+ if (!qApp->notify(window1.data(), &me))
+ qWarning("Mouse event MousePress not accepted by receiving window");
}
{
QMouseEvent me = QMouseEvent(QEvent::MouseButtonPress, pos, window1->mapToGlobal(pos), Qt::LeftButton, {}, Qt::NoModifier);
QSpontaneKeyEvent::setSpontaneous(&me);
- if (!qApp->notify(window1.data(), &me)) {
- QString warning = QString::fromLatin1("Mouse event MouseRelease not accepted by receiving window");
- QWARN(warning.toLatin1().data());
- }
+ if (!qApp->notify(window1.data(), &me))
+ qWarning("Mouse event MouseRelease not accepted by receiving window");
}
QTRY_COMPARE(QGuiApplication::focusWindow(), windows.at(0));