From 08444bab1bf25e20837ea47b647a5b1216caa05c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 13 Sep 2012 14:35:42 +0200 Subject: Autotests: Use qInstallMessageHandler qInstallMsgHandler got deprecated in Qt 5. Change-Id: Icb6423c7d9f7e507ba36376b0af5ad183379c494 Reviewed-by: Martin Jones --- tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto/qml/qqmlcomponent') diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp index 3a3952d101..01cec58f0e 100644 --- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp +++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp @@ -227,9 +227,9 @@ void tst_qqmlcomponent::qmlCreateObjectWithProperties() } static QStringList warnings; -static void msgHandler(QtMsgType, const char *warning) +static void msgHandler(QtMsgType, const QMessageLogContext &, const QString &warning) { - warnings << QString::fromUtf8(warning); + warnings << warning; } void tst_qqmlcomponent::qmlCreateParentReference() @@ -239,7 +239,7 @@ void tst_qqmlcomponent::qmlCreateParentReference() QCOMPARE(engine.outputWarningsToStandardError(), true); warnings.clear(); - QtMsgHandler old = qInstallMsgHandler(msgHandler); + QtMessageHandler old = qInstallMessageHandler(msgHandler); QQmlComponent component(&engine, testFileUrl("createParentReference.qml")); QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8()); @@ -249,7 +249,7 @@ void tst_qqmlcomponent::qmlCreateParentReference() QVERIFY(QMetaObject::invokeMethod(object, "createChild")); delete object; - qInstallMsgHandler(old); + qInstallMessageHandler(old); engine.setOutputWarningsToStandardError(false); QCOMPARE(engine.outputWarningsToStandardError(), false); @@ -399,12 +399,12 @@ void tst_qqmlcomponent::onDestructionCount() QCOMPARE(engine.outputWarningsToStandardError(), true); warnings.clear(); - QtMsgHandler old = qInstallMsgHandler(msgHandler); + QtMessageHandler old = qInstallMessageHandler(msgHandler); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QCoreApplication::processEvents(); - qInstallMsgHandler(old); + qInstallMessageHandler(old); engine.setOutputWarningsToStandardError(false); QCOMPARE(engine.outputWarningsToStandardError(), false); -- cgit v1.2.3