From d914a5ba4e2f0c208473d5e76adb7d16e2e8e706 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 30 Jul 2019 17:16:50 +0200 Subject: Remove the remaining usages of deprecated APIs of qtbase This change removes the leftovers form other cleanup commits. Task-number: QTBUG-76491 Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e Reviewed-by: Volker Hilsheimer Reviewed-by: Alex Blasche --- tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp | 4 ++++ tests/auto/corelib/tools/qline/tst_qline.cpp | 5 ++++- tests/auto/network/socket/qudpsocket/clientserver/main.cpp | 2 +- tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp index 112c36952c..60e8d8cba2 100644 --- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp +++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp @@ -92,7 +92,9 @@ private slots: void priorityStart(); void waitForDone(); void clear(); +#if QT_DEPRECATED_SINCE(5, 9) void cancel(); +#endif void tryTake(); void waitForDoneTimeout(); void destroyingWaitsForTasksToFinish(); @@ -963,6 +965,7 @@ void tst_QThreadPool::clear() QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount()); } +#if QT_DEPRECATED_SINCE(5, 9) void tst_QThreadPool::cancel() { QSemaphore sem(0); @@ -1034,6 +1037,7 @@ void tst_QThreadPool::cancel() delete runnables[0]; //if the pool deletes them then we'll get double-free crash delete runnables[runs-1]; } +#endif void tst_QThreadPool::tryTake() { diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp index 0418daf640..31aa5b4e0c 100644 --- a/tests/auto/corelib/tools/qline/tst_qline.cpp +++ b/tests/auto/corelib/tools/qline/tst_qline.cpp @@ -207,7 +207,10 @@ void tst_QLine::testIntersection() QPointF ip; - QLineF::IntersectionType itype = a.intersect(b, &ip); + QLineF::IntersectionType itype = a.intersects(b, &ip); +#if QT_DEPRECATED_SINCE(5, 14) + QCOMPARE(a.intersect(b, &ip), itype); +#endif QCOMPARE(int(itype), type); if (type != QLineF::NoIntersection) { diff --git a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp index cc3e90671a..8172cd4f6f 100644 --- a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp +++ b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp @@ -54,7 +54,7 @@ public: printf("ok\n"); break; case UnconnectedClient: - peerAddress = host; + peerAddress = QHostAddress(host); peerPort = port; if (bind(QHostAddress::Any, port + 1, ShareAddress | ReuseAddressHint)) { startTimer(250); diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp index d1b4ed8bcd..81b49a3a87 100644 --- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp +++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp @@ -302,10 +302,12 @@ void tst_QPrinterInfo::testConstructors() QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize()); QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize()); QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes()); +#if QT_DEPRECATED_SINCE(5, 3) QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED QCOMPARE(copy1.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames()); QT_WARNING_POP +#endif QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions()); QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode()); QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes()); @@ -326,10 +328,12 @@ QT_WARNING_POP QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize()); QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize()); QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes()); +#if QT_DEPRECATED_SINCE(5, 3) QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED QCOMPARE(copy2.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames()); QT_WARNING_POP +#endif QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions()); QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode()); QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes()); -- cgit v1.2.3