summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-07-10 17:04:42 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-07-13 10:43:15 +0200
commit2f33e030b8c80b4665cc2c120df7833469c05145 (patch)
treec82580c8ef761ddd5e22f695dc5934753429436d /tests/auto/gui/kernel
parente89b2f72c7147e46dcf606c3dcc507e2ae2841ce (diff)
Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Modified the tests to make them build when deprecated APIs disabled: * Made the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/gui/kernel')
-rw-r--r--tests/auto/gui/kernel/qdrag/tst_qdrag.cpp9
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp2
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
index 68852f5a3f..d67b17fd43 100644
--- a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
+++ b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
@@ -68,10 +68,17 @@ void tst_QDrag::getSetCheck()
QCOMPARE((QMimeData *)0, obj1.mimeData());
// delete var1; // No delete, since QDrag takes ownership
- Qt::DropAction result = obj1.start();
+ Qt::DropAction result = obj1.exec();
+ QCOMPARE(result, Qt::IgnoreAction);
+ result = obj1.exec(Qt::MoveAction | Qt::LinkAction);
+ QCOMPARE(result, Qt::IgnoreAction);
+
+#if QT_DEPRECATED_SINCE(5, 13)
+ result = obj1.start();
QCOMPARE(result, Qt::IgnoreAction);
result = obj1.start(Qt::MoveAction | Qt::LinkAction);
QCOMPARE(result, Qt::IgnoreAction);
+#endif
}
QTEST_MAIN(tst_QDrag)
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index b2572188b9..3ce65a6785 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -191,7 +191,7 @@ template<> struct TestValueFactory<QMetaType::QTextLength> {
static QTextLength *create() { return new QTextLength(QTextLength::PercentageLength, 50); }
};
template<> struct TestValueFactory<QMetaType::QTextFormat> {
- static QTextFormat *create() { return new QTextFormat(QTextFormat::TableFormat); }
+ static QTextFormat *create() { return new QTextFormat(QTextFormat::FrameFormat); }
};
template<> struct TestValueFactory<QMetaType::QMatrix> {
static QMatrix *create() { return new QMatrix(10, 20, 30, 40, 50, 60); }