From 50b9e30970effae249010338880f74641f188f76 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Aug 2015 13:35:22 +0200 Subject: [PATCH] qtbase tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases. Fix usage of API that is marked deprecated. Change-Id: Ie31b6ee029c5b5f015fe52fb9bcd8e94b22d6cd0 Reviewed-by: Liang Qi --- .../qidentityproxymodel.pro | 1 - .../qitemselectionmodel.pro | 1 - .../tst_qitemselectionmodel.cpp | 2 +- .../qsortfilterproxymodel.pro | 1 - .../tst_qsortfilterproxymodel.cpp | 7 +++++-- .../gui/kernel/qkeysequence/qkeysequence.pro | 1 - .../kernel/qkeysequence/tst_qkeysequence.cpp | 4 ++-- tests/auto/gui/painting/qpainter/qpainter.pro | 1 - .../gui/painting/qpainter/tst_qpainter.cpp | 2 +- tests/auto/gui/text/qfont/qfont.pro | 3 --- tests/auto/gui/text/qfont/tst_qfont.cpp | 4 ++-- .../other/languagechange/languagechange.pro | 1 - .../languagechange/tst_languagechange.cpp | 2 +- .../auto/other/modeltest/dynamictreemodel.cpp | 3 ++- tests/auto/other/modeltest/modeltest.pro | 4 ---- .../other/qaccessibility/qaccessibility.pro | 1 - .../qaccessibility/tst_qaccessibility.cpp | 6 +++--- .../benchmarks/gui/kernel/qwidget/qwidget.pro | 1 - .../gui/kernel/qwidget/tst_qwidget.cpp | 2 +- .../gui/painting/qtbench/qtbench.pro | 2 -- .../gui/painting/qtbench/tst_qtbench.cpp | 2 +- .../gui/styles/qstylesheetstyle/main.cpp | 2 +- .../qstylesheetstyle/qstylesheetstyle.pro | 1 - .../network_remote_stresstest.pro | 1 - .../tst_network_remote_stresstest.cpp | 19 +++++++++++-------- .../device_information/device_information.pro | 1 - .../device_information/tabletwidget.cpp | 2 +- 27 files changed, 32 insertions(+), 45 deletions(-) diff --git a/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro index f57b419ae5..6de1ffaca2 100644 --- a/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro +++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro @@ -7,4 +7,3 @@ INCLUDEPATH += $$PWD/$${mtdir} QT += testlib SOURCES += tst_qidentityproxymodel.cpp $${mtdir}/dynamictreemodel.cpp $${mtdir}/modeltest.cpp HEADERS += $${mtdir}/dynamictreemodel.h $${mtdir}/modeltest.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro index 1b6279ba1b..5a543c23be 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro @@ -3,4 +3,3 @@ CONFIG += parallel_test TARGET = tst_qitemselectionmodel QT += testlib SOURCES += tst_qitemselectionmodel.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp index 3a0c8b83dd..9d1e1c9657 100644 --- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -1512,7 +1512,7 @@ class MyStandardItemModel: public QStandardItemModel Q_OBJECT public: inline MyStandardItemModel(int i1, int i2): QStandardItemModel(i1, i2) {} - inline void reset() { QStandardItemModel::reset(); } + inline void reset() { beginResetModel(); endResetModel(); } }; void tst_QItemSelectionModel::resetModel() diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro index 25947990a7..df8302529f 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro @@ -8,4 +8,3 @@ mtdir = ../../../other/modeltest INCLUDEPATH += $$PWD/$${mtdir} SOURCES += tst_qsortfilterproxymodel.cpp $${mtdir}/dynamictreemodel.cpp $${mtdir}/modeltest.cpp HEADERS += $${mtdir}/dynamictreemodel.h $${mtdir}/modeltest.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index bf8276614a..c37d8cd468 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -2581,7 +2581,7 @@ void tst_QSortFilterProxyModel::hiddenColumns() public: MyStandardItemModel() : QStandardItemModel(0,5) {} void reset() - { QStandardItemModel::reset(); } + { beginResetModel(); endResetModel(); } friend class tst_QSortFilterProxyModel; } model; QSortFilterProxyModel proxy; @@ -3377,7 +3377,10 @@ void tst_QSortFilterProxyModel::resetInvalidate() { switch (test) { case 0: break; - case 1: reset(); break; + case 1: + beginResetModel(); + endResetModel(); + break; case 2: invalidate(); break; case 3: invalidateFilter(); break; } diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro index 7c1e8d52de..82c471e803 100644 --- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro +++ b/tests/auto/gui/kernel/qkeysequence/qkeysequence.pro @@ -8,4 +8,3 @@ QT += core-private gui-private SOURCES += tst_qkeysequence.cpp RESOURCES += qkeysequence.qrc -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 3fcbd0a16f..84680fb7a6 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -250,7 +250,7 @@ void tst_QKeySequence::operatorQString() seq = QKeySequence( modifiers | keycode ); - QCOMPARE( (QString)seq, keystring ); + QCOMPARE( seq.toString(QKeySequence::NativeText), keystring ); } // this verifies that the constructors can handle the same strings in and out @@ -260,7 +260,7 @@ void tst_QKeySequence::symetricConstructors() QFETCH( int, keycode ); QKeySequence seq1( modifiers | keycode ); - QKeySequence seq2( (QString)seq1 ); + QKeySequence seq2( seq1.toString(QKeySequence::NativeText) ); QVERIFY( seq1 == seq2 ); } diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro index e90b516ef2..d0d8b89c94 100644 --- a/tests/auto/gui/painting/qpainter/qpainter.pro +++ b/tests/auto/gui/painting/qpainter/qpainter.pro @@ -9,7 +9,6 @@ SOURCES += tst_qpainter.cpp TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \ task217400.png -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 android: !android-no-sdk { RESOURCES += \ diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index e8d90edd2d..210939c7f0 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -4487,7 +4487,7 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate() TestWidget *widget = new TestWidget(); proxy->setWidget(widget); scene->addItem(proxy); - proxy->rotate(45); + proxy->setTransform(QTransform().rotate(45)); w->resize(scene->sceneRect().size().toSize()); w->show(); diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro index ced66c226c..d3088fffd0 100644 --- a/tests/auto/gui/text/qfont/qfont.pro +++ b/tests/auto/gui/text/qfont/qfont.pro @@ -5,6 +5,3 @@ QT += testlib QT += core-private gui-private qtHaveModule(widgets): QT += widgets SOURCES += tst_qfont.cpp - - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 462e5115b4..1e0c3d0a75 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -504,7 +504,7 @@ void tst_QFont::isCopyOf() void tst_QFont::insertAndRemoveSubstitutions() { - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty before we start QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); @@ -521,7 +521,7 @@ void tst_QFont::insertAndRemoveSubstitutions() QCOMPARE(QFont::substitutes("BogusFontFamily").count(), 3); QCOMPARE(QFont::substitutes("bogusfontfamily").count(), 3); - QFont::removeSubstitution("BogusFontFamily"); + QFont::removeSubstitutions("BogusFontFamily"); // make sure it is empty again QVERIFY(QFont::substitutes("BogusFontFamily").isEmpty()); QVERIFY(QFont::substitutes("bogusfontfamily").isEmpty()); diff --git a/tests/auto/other/languagechange/languagechange.pro b/tests/auto/other/languagechange/languagechange.pro index 0b9c04d2ed..25dbcc19be 100644 --- a/tests/auto/other/languagechange/languagechange.pro +++ b/tests/auto/other/languagechange/languagechange.pro @@ -4,4 +4,3 @@ win32:testcase.timeout = 1800 # test runtime varies greatly on Windows, QTBUG- TARGET = tst_languagechange QT += widgets core-private gui-private testlib SOURCES += tst_languagechange.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index 788993ef35..7658aaa8e0 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -253,7 +253,7 @@ void tst_languageChange::retranslatability() switch (dialogType) { case InputDialog: stateMachine.start(); - QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label")); + QInputDialog::getInt(0, QLatin1String("title"), QLatin1String("label")); break; case ColorDialog: diff --git a/tests/auto/other/modeltest/dynamictreemodel.cpp b/tests/auto/other/modeltest/dynamictreemodel.cpp index c7cf04231f..bdf2b604fd 100644 --- a/tests/auto/other/modeltest/dynamictreemodel.cpp +++ b/tests/auto/other/modeltest/dynamictreemodel.cpp @@ -299,7 +299,8 @@ bool ModelResetCommand::emitPreSignal(const QModelIndex &srcParent, int srcStart void ModelResetCommand::emitPostSignal() { - m_model->reset(); + m_model->beginResetModel(); + m_model->endResetModel(); } ModelResetCommandFixed::ModelResetCommandFixed(DynamicTreeModel* model, QObject* parent) diff --git a/tests/auto/other/modeltest/modeltest.pro b/tests/auto/other/modeltest/modeltest.pro index 045299e095..8e96058449 100644 --- a/tests/auto/other/modeltest/modeltest.pro +++ b/tests/auto/other/modeltest/modeltest.pro @@ -3,7 +3,3 @@ TARGET = tst_modeltest QT += widgets testlib SOURCES += tst_modeltest.cpp modeltest.cpp dynamictreemodel.cpp HEADERS += modeltest.h dynamictreemodel.h - - - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 1d6fc6bcd1..ef3b469ba1 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -21,4 +21,3 @@ win32 { LIBS += -luuid !winphone: LIBS += -loleacc -loleaut32 -lole32 } -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 69007bd250..a4da17e9b7 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1763,7 +1763,7 @@ void tst_QAccessibility::textEditTest() } edit.show(); - QTest::qWaitForWindowShown(&edit); + QTest::qWaitForWindowExposed(&edit); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&edit); QCOMPARE(iface->text(QAccessible::Value), edit.toPlainText()); QVERIFY(iface->state().focusable); @@ -2175,7 +2175,7 @@ void tst_QAccessibility::lineEditTest() QLineEdit le(QStringLiteral("My characters have geometries."), toplevel); // characterRect() le.show(); - QTest::qWaitForWindowShown(&le); + QTest::qWaitForWindowExposed(&le); QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(&le)); QAccessibleTextInterface* textIface = iface->textInterface(); QVERIFY(textIface); @@ -3576,7 +3576,7 @@ void tst_QAccessibility::comboBoxTest() // Fully decorated windows have a minimum width of 160 on Windows. combo.setMinimumWidth(200); combo.show(); - QVERIFY(QTest::qWaitForWindowShown(&combo)); + QVERIFY(QTest::qWaitForWindowExposed(&combo)); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&combo); QCOMPARE(verifyHierarchy(iface), 0); diff --git a/tests/benchmarks/gui/kernel/qwidget/qwidget.pro b/tests/benchmarks/gui/kernel/qwidget/qwidget.pro index 6db601d70a..758c9c5b98 100644 --- a/tests/benchmarks/gui/kernel/qwidget/qwidget.pro +++ b/tests/benchmarks/gui/kernel/qwidget/qwidget.pro @@ -2,4 +2,3 @@ QT += widgets testlib TARGET = tst_bench_qwidget SOURCES += tst_qwidget.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp index 839d4535cb..289ed3bf06 100644 --- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp +++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp @@ -128,7 +128,7 @@ private: void tst_QWidget::initTestCase() { widget.show(); - QTest::qWaitForWindowShown(&widget); + QTest::qWaitForWindowExposed(&widget); QTest::qWait(300); processEvents(); } diff --git a/tests/benchmarks/gui/painting/qtbench/qtbench.pro b/tests/benchmarks/gui/painting/qtbench/qtbench.pro index 46c2f06984..a4c7273b47 100644 --- a/tests/benchmarks/gui/painting/qtbench/qtbench.pro +++ b/tests/benchmarks/gui/painting/qtbench/qtbench.pro @@ -4,5 +4,3 @@ TEMPLATE = app TARGET = tst_bench_qtbench SOURCES += tst_qtbench.cpp - -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp index c7ba7b82f6..cc9fe7e32e 100644 --- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp +++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp @@ -229,7 +229,7 @@ void tst_QtBench::qtBench() BenchWidget widget(reinterpret_cast(benchmark)); widget.show(); - QTest::qWaitForWindowShown(&widget); + QTest::qWaitForWindowExposed(&widget); while (!widget.done()) { widget.update(); diff --git a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp index e4d5999c62..bb5399707c 100644 --- a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp +++ b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp @@ -173,7 +173,7 @@ void tst_qstylesheetstyle::grid() w->setStyleSheet("/* */"); if(show) { w->show(); - QTest::qWaitForWindowShown(w); + QTest::qWaitForWindowExposed(w); QApplication::flush(); QApplication::processEvents(); QTest::qWait(30); diff --git a/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro index 707731f4d1..5aef3520c0 100644 --- a/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro +++ b/tests/benchmarks/gui/styles/qstylesheetstyle/qstylesheetstyle.pro @@ -5,4 +5,3 @@ TARGET = tst_bench_qstylesheetstyle CONFIG += release SOURCES += main.cpp -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro index 736747e486..754776f7e9 100644 --- a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro +++ b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro @@ -7,4 +7,3 @@ SOURCES += tst_network_remote_stresstest.cpp RESOURCES += url-list.qrc LIBS += $$QMAKE_LIBS_NETWORK -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index 486c5179b7..df61325439 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -246,30 +246,31 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() socket = QSharedPointer(new QTcpSocket); socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); - QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + url.encodedHost()); + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); + QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + encodedHost); #ifndef QT_NO_SSL if (isHttps) { static_cast(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast(socket.data())->startClientEncryption(); static_cast(socket.data())->ignoreSslErrors(); - QVERIFY2(static_cast(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + url.encodedHost()); + QVERIFY2(static_cast(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + encodedHost); } #endif // QT_NO_SSL socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); while (socket->bytesToWrite()) - QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + url.encodedHost()); + QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + encodedHost); while (socket->state() == QAbstractSocket::ConnectedState && !timeout.hasExpired(10000)) { socket->waitForReadyRead(10000); byteCounter += socket->readAll().size(); // discard } - QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + url.encodedHost()); + QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + encodedHost); totalBytes += byteCounter; if (intermediateDebug) { @@ -318,16 +319,17 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() socket->connectToHost(url.host(), url.port(80)); } + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); connect(socket.data(), SIGNAL(readyRead()), SLOT(slotReadAll())); QTestEventLoop::instance().connect(socket.data(), SIGNAL(disconnected()), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(30); - QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + url.encodedHost() + "; " + QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + encodedHost + "; " + QByteArray::number(socket->bytesToWrite()) + " bytes to write"); totalBytes += byteCounter; @@ -397,10 +399,11 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); } + const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1(); socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" "User-Agent: tst_QTcpSocket_stresstest/1.0\r\n" - "Host: " + url.encodedHost() + "\r\n" + "Host: " + encodedHost + "\r\n" "\r\n"); connect(socket, SIGNAL(readyRead()), SLOT(slotReadAll())); QTestEventLoop::instance().connect(socket, SIGNAL(disconnected()), SLOT(exitLoop())); diff --git a/tests/manual/qtabletevent/device_information/device_information.pro b/tests/manual/qtabletevent/device_information/device_information.pro index 59669843ba..727ad34bc1 100644 --- a/tests/manual/qtabletevent/device_information/device_information.pro +++ b/tests/manual/qtabletevent/device_information/device_information.pro @@ -4,4 +4,3 @@ SOURCES += \ tabletwidget.cpp HEADERS += \ tabletwidget.h -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp index 2e4cb6658f..e35cee65e8 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp +++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp @@ -61,7 +61,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev) mType = event->type(); mPos = event->pos(); mGPos = event->globalPos(); - mHiResGlobalPos = event->hiResGlobalPos(); + mHiResGlobalPos = event->posF(); mDev = event->device(); mPointerType = event->pointerType(); mUnique = event->uniqueId();