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>
This commit is contained in:
Sona Kurazyan 2019-07-30 17:16:50 +02:00
parent a2c18fd10c
commit d914a5ba4e
5 changed files with 14 additions and 3 deletions

View File

@ -105,7 +105,7 @@ public:
m_green = new LightWidget(Qt::green); m_green = new LightWidget(Qt::green);
vbox->addWidget(m_green); vbox->addWidget(m_green);
QPalette pal = palette(); QPalette pal = palette();
pal.setColor(QPalette::Background, Qt::black); pal.setColor(QPalette::Window, Qt::black);
setPalette(pal); setPalette(pal);
setAutoFillBackground(true); setAutoFillBackground(true);
} }

View File

@ -92,7 +92,9 @@ private slots:
void priorityStart(); void priorityStart();
void waitForDone(); void waitForDone();
void clear(); void clear();
#if QT_DEPRECATED_SINCE(5, 9)
void cancel(); void cancel();
#endif
void tryTake(); void tryTake();
void waitForDoneTimeout(); void waitForDoneTimeout();
void destroyingWaitsForTasksToFinish(); void destroyingWaitsForTasksToFinish();
@ -963,6 +965,7 @@ void tst_QThreadPool::clear()
QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount()); QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount());
} }
#if QT_DEPRECATED_SINCE(5, 9)
void tst_QThreadPool::cancel() void tst_QThreadPool::cancel()
{ {
QSemaphore sem(0); 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[0]; //if the pool deletes them then we'll get double-free crash
delete runnables[runs-1]; delete runnables[runs-1];
} }
#endif
void tst_QThreadPool::tryTake() void tst_QThreadPool::tryTake()
{ {

View File

@ -207,7 +207,10 @@ void tst_QLine::testIntersection()
QPointF ip; 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); QCOMPARE(int(itype), type);
if (type != QLineF::NoIntersection) { if (type != QLineF::NoIntersection) {

View File

@ -54,7 +54,7 @@ public:
printf("ok\n"); printf("ok\n");
break; break;
case UnconnectedClient: case UnconnectedClient:
peerAddress = host; peerAddress = QHostAddress(host);
peerPort = port; peerPort = port;
if (bind(QHostAddress::Any, port + 1, ShareAddress | ReuseAddressHint)) { if (bind(QHostAddress::Any, port + 1, ShareAddress | ReuseAddressHint)) {
startTimer(250); startTimer(250);

View File

@ -302,10 +302,12 @@ void tst_QPrinterInfo::testConstructors()
QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize()); QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize()); QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes()); QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes());
#if QT_DEPRECATED_SINCE(5, 3)
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_DEPRECATED
QCOMPARE(copy1.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames()); QCOMPARE(copy1.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
QT_WARNING_POP QT_WARNING_POP
#endif
QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions()); QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions());
QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode()); QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes()); QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
@ -326,10 +328,12 @@ QT_WARNING_POP
QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize()); QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize()); QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes()); QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes());
#if QT_DEPRECATED_SINCE(5, 3)
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_DEPRECATED
QCOMPARE(copy2.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames()); QCOMPARE(copy2.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
QT_WARNING_POP QT_WARNING_POP
#endif
QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions()); QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions());
QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode()); QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes()); QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes());