summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-07-30 17:16:50 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-08-01 06:48:27 +0200
commitd914a5ba4e2f0c208473d5e76adb7d16e2e8e706 (patch)
tree09bca20a2129c4b40836ff26ce404f6b46da8436
parenta2c18fd10ca046b52d701e1bfe6e456d6cabec50 (diff)
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 <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/widgets/statemachine/trafficlight/main.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp4
-rw-r--r--tests/auto/corelib/tools/qline/tst_qline.cpp5
-rw-r--r--tests/auto/network/socket/qudpsocket/clientserver/main.cpp2
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp4
5 files changed, 14 insertions, 3 deletions
diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp
index 1a7050c28d..a12d2f10d1 100644
--- a/examples/widgets/statemachine/trafficlight/main.cpp
+++ b/examples/widgets/statemachine/trafficlight/main.cpp
@@ -105,7 +105,7 @@ public:
m_green = new LightWidget(Qt::green);
vbox->addWidget(m_green);
QPalette pal = palette();
- pal.setColor(QPalette::Background, Qt::black);
+ pal.setColor(QPalette::Window, Qt::black);
setPalette(pal);
setAutoFillBackground(true);
}
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());