aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/qjsvalue/qjsvalue.pro1
-rw-r--r--tests/auto/qml/qjsvalue/tst_qjsvalue.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/qqmlecmascript.pro2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp32
-rw-r--r--tests/auto/qml/qqmlimport/qqmlimport.pro1
-rw-r--r--tests/auto/qml/qqmlimport/tst_qqmlimport.cpp2
-rw-r--r--tests/auto/qml/qqmllanguage/qqmllanguage.pro1
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp6
8 files changed, 19 insertions, 28 deletions
diff --git a/tests/auto/qml/qjsvalue/qjsvalue.pro b/tests/auto/qml/qjsvalue/qjsvalue.pro
index d914d40762..08af6830ec 100644
--- a/tests/auto/qml/qjsvalue/qjsvalue.pro
+++ b/tests/auto/qml/qjsvalue/qjsvalue.pro
@@ -5,4 +5,3 @@ macx:CONFIG -= app_bundle
QT += qml widgets testlib gui-private
SOURCES += tst_qjsvalue.cpp
HEADERS += tst_qjsvalue.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
index bea44cb6e3..c3d95a10fb 100644
--- a/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/auto/qml/qjsvalue/tst_qjsvalue.cpp
@@ -1015,7 +1015,7 @@ void tst_QJSValue::toVariant()
{
QVariant var = qobject.toVariant();
QCOMPARE(var.userType(), int(QMetaType::QObjectStar));
- QCOMPARE(qVariantValue<QObject*>(var), (QObject *)&temp);
+ QCOMPARE(qvariant_cast<QObject*>(var), (QObject *)&temp);
}
{
diff --git a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro
index 6f3f765aba..101181bba0 100644
--- a/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro
+++ b/tests/auto/qml/qqmlecmascript/qqmlecmascript.pro
@@ -20,5 +20,3 @@ TESTDATA = data/*
QT += core-private gui-private qml-private network testlib
qtHaveModule(widgets): QT += widgets
-
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 222e594d1a..a1038b0f52 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -4911,7 +4911,7 @@ void tst_qqmlecmascript::propertyVarImplicitOwnership()
QCOMPARE(rootObject->property("rectCanary").toInt(), 5);
QCOMPARE(childObject->property("textCanary").toInt(), 10);
QMetaObject::invokeMethod(childObject, "constructQObject"); // creates a reference to a constructed QObject.
- QWeakPointer<QObject> qobjectGuard(childObject->property("vp").value<QObject*>()); // get the pointer prior to processing deleteLater events.
+ QPointer<QObject> qobjectGuard(childObject->property("vp").value<QObject*>()); // get the pointer prior to processing deleteLater events.
QVERIFY(!qobjectGuard.isNull());
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // process deleteLater() events from QV8QObjectWrapper.
QCoreApplication::processEvents();
@@ -4934,9 +4934,9 @@ void tst_qqmlecmascript::propertyVarReparent()
QObject *rect = object->property("vp").value<QObject*>();
QObject *text = rect->findChild<QObject*>("textOne");
QObject *text2 = rect->findChild<QObject*>("textTwo");
- QWeakPointer<QObject> rectGuard(rect);
- QWeakPointer<QObject> textGuard(text);
- QWeakPointer<QObject> text2Guard(text2);
+ QPointer<QObject> rectGuard(rect);
+ QPointer<QObject> textGuard(text);
+ QPointer<QObject> text2Guard(text2);
QVERIFY(!rectGuard.isNull());
QVERIFY(!textGuard.isNull());
QVERIFY(!text2Guard.isNull());
@@ -4945,7 +4945,7 @@ void tst_qqmlecmascript::propertyVarReparent()
// now construct an image which we will reparent.
QMetaObject::invokeMethod(text2, "constructQObject");
QObject *image = text2->property("vp").value<QObject*>();
- QWeakPointer<QObject> imageGuard(image);
+ QPointer<QObject> imageGuard(image);
QVERIFY(!imageGuard.isNull());
QCOMPARE(image->property("imageCanary").toInt(), 13);
// now reparent the "Image" object (currently, it has JS ownership)
@@ -4976,9 +4976,9 @@ void tst_qqmlecmascript::propertyVarReparentNullContext()
QObject *rect = object->property("vp").value<QObject*>();
QObject *text = rect->findChild<QObject*>("textOne");
QObject *text2 = rect->findChild<QObject*>("textTwo");
- QWeakPointer<QObject> rectGuard(rect);
- QWeakPointer<QObject> textGuard(text);
- QWeakPointer<QObject> text2Guard(text2);
+ QPointer<QObject> rectGuard(rect);
+ QPointer<QObject> textGuard(text);
+ QPointer<QObject> text2Guard(text2);
QVERIFY(!rectGuard.isNull());
QVERIFY(!textGuard.isNull());
QVERIFY(!text2Guard.isNull());
@@ -4987,7 +4987,7 @@ void tst_qqmlecmascript::propertyVarReparentNullContext()
// now construct an image which we will reparent.
QMetaObject::invokeMethod(text2, "constructQObject");
QObject *image = text2->property("vp").value<QObject*>();
- QWeakPointer<QObject> imageGuard(image);
+ QPointer<QObject> imageGuard(image);
QVERIFY(!imageGuard.isNull());
QCOMPARE(image->property("imageCanary").toInt(), 13);
// now reparent the "Image" object (currently, it has JS ownership)
@@ -5045,9 +5045,9 @@ void tst_qqmlecmascript::propertyVarCircular2()
QVERIFY(rootObject != 0);
QObject *childObject = rootObject->findChild<QObject*>("text");
QVERIFY(childObject != 0);
- QWeakPointer<QObject> rootObjectTracker(rootObject);
+ QPointer<QObject> rootObjectTracker(rootObject);
QVERIFY(!rootObjectTracker.isNull());
- QWeakPointer<QObject> childObjectTracker(childObject);
+ QPointer<QObject> childObjectTracker(childObject);
QVERIFY(!childObjectTracker.isNull());
gc(engine);
QCOMPARE(rootObject->property("rectCanary").toInt(), 5);
@@ -6614,8 +6614,7 @@ void tst_qqmlecmascript::urlPropertyWithEncoding()
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
QVERIFY(object != 0);
object->setStringProperty("http://qt-project.org");
- QUrl encoded;
- encoded.setEncodedUrl("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
+ const QUrl encoded = QUrl::fromEncoded("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
QCOMPARE(object->urlProperty(), encoded);
QCOMPARE(object->value(), 0); // Interpreting URL as string yields canonicalised version
QCOMPARE(object->property("result").toBool(), true);
@@ -6633,8 +6632,7 @@ void tst_qqmlecmascript::urlListPropertyWithEncoding()
MySequenceConversionObject *msco3 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco3"));
MySequenceConversionObject *msco4 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco4"));
QVERIFY(msco1 != 0 && msco2 != 0 && msco3 != 0 && msco4 != 0);
- QUrl encoded;
- encoded.setEncodedUrl("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
+ const QUrl encoded = QUrl::fromEncoded("http://qt-project.org/?get%3cDATA%3e", QUrl::TolerantMode);
QCOMPARE(msco1->urlListProperty(), (QList<QUrl>() << encoded));
QCOMPARE(msco2->urlListProperty(), (QList<QUrl>() << encoded));
QCOMPARE(msco3->urlListProperty(), (QList<QUrl>() << encoded << encoded));
@@ -7331,7 +7329,7 @@ void tst_qqmlecmascript::sequenceSort_data()
QString fnName = QLatin1String("test_") + testName;
bool useComparer = c != 0;
testName += useComparer ? QLatin1String("[custom]") : QLatin1String("[default]");
- QTest::newRow(testName.toAscii().constData()) << fnName << useComparer;
+ QTest::newRow(testName.toLatin1().constData()) << fnName << useComparer;
}
}
}
@@ -7350,7 +7348,7 @@ void tst_qqmlecmascript::sequenceSort()
QVERIFY(object != 0);
QVariant q;
- QMetaObject::invokeMethod(object, function.toAscii().constData(), Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, useComparer));
+ QMetaObject::invokeMethod(object, function.toLatin1().constData(), Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, useComparer));
QVERIFY(q.toBool());
delete object;
diff --git a/tests/auto/qml/qqmlimport/qqmlimport.pro b/tests/auto/qml/qqmlimport/qqmlimport.pro
index 6c99c00570..193f327dc1 100644
--- a/tests/auto/qml/qqmlimport/qqmlimport.pro
+++ b/tests/auto/qml/qqmlimport/qqmlimport.pro
@@ -8,4 +8,3 @@ SOURCES += tst_qqmlimport.cpp
include (../../shared/util.pri)
CONFIG += parallel_test
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
index c53977482b..ab3d020c82 100644
--- a/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
+++ b/tests/auto/qml/qqmlimport/tst_qqmlimport.cpp
@@ -81,7 +81,7 @@ void tst_QQmlImport::testDesignerSupported()
warningString.remove('\r');
#endif
warningString = warningString.arg(testFileUrl("testfile_unsupported.qml").toString());
- QTest::ignoreMessage(QtWarningMsg, warningString.toAscii());
+ QTest::ignoreMessage(QtWarningMsg, warningString.toLocal8Bit());
window->setSource(testFileUrl("testfile_unsupported.qml"));
QVERIFY(!window->errors().isEmpty());
diff --git a/tests/auto/qml/qqmllanguage/qqmllanguage.pro b/tests/auto/qml/qqmllanguage/qqmllanguage.pro
index f0c8bb6c1b..99c0c3e823 100644
--- a/tests/auto/qml/qqmllanguage/qqmllanguage.pro
+++ b/tests/auto/qml/qqmllanguage/qqmllanguage.pro
@@ -15,7 +15,6 @@ TESTDATA = data/*
QT += core-private gui-private qml-private network testlib
include (../../shared/util.pri)
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
OTHER_FILES += \
data/readonlyObjectProperty.qml
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 97501118dd..7893114500 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -673,8 +673,7 @@ void tst_qqmllanguage::assignBasicTypes()
QCOMPARE(object->variantProperty(), QVariant("Hello World!"));
QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2f));
QCOMPARE(object->vector4Property(), QVector4D(10, 1, 2.2f, 2.3f));
- QUrl encoded;
- encoded.setEncodedUrl("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
+ const QUrl encoded = QUrl::fromEncoded("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
QCOMPARE(object->urlProperty(), component.url().resolved(encoded));
QVERIFY(object->objectProperty() != 0);
MyTypeObject *child = qobject_cast<MyTypeObject *>(object->objectProperty());
@@ -1152,8 +1151,7 @@ void tst_qqmllanguage::bindTypeToJSValue()
} {
MyQmlObject *object = root->findChild<MyQmlObject *>("urlProperty");
QJSValue value = object->qjsvalue();
- QUrl encoded;
- encoded.setEncodedUrl("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
+ const QUrl encoded = QUrl::fromEncoded("main.qml?with%3cencoded%3edata", QUrl::TolerantMode);
QCOMPARE(value.toString(), component.url().resolved(encoded).toString());
} {
MyQmlObject *object = root->findChild<MyQmlObject *>("objectProperty");