diff options
Diffstat (limited to 'tests/manual')
50 files changed, 115 insertions, 331 deletions
diff --git a/tests/manual/cocoa/menurama/menurama.pro b/tests/manual/cocoa/menurama/menurama.pro index da6f224e0d..f0928be31d 100644 --- a/tests/manual/cocoa/menurama/menurama.pro +++ b/tests/manual/cocoa/menurama/menurama.pro @@ -4,9 +4,7 @@ # #------------------------------------------------- -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = Menurama TEMPLATE = app diff --git a/tests/manual/corelib/tools/qhash/main.cpp b/tests/manual/corelib/tools/qhash/main.cpp index b2c40f2183..298d1777ea 100644 --- a/tests/manual/corelib/tools/qhash/main.cpp +++ b/tests/manual/corelib/tools/qhash/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QHash> void testEraseNoError() diff --git a/tests/manual/corelib/tools/qlist/main.cpp b/tests/manual/corelib/tools/qlist/main.cpp index 3f8ade5778..0b54105f5e 100644 --- a/tests/manual/corelib/tools/qlist/main.cpp +++ b/tests/manual/corelib/tools/qlist/main.cpp @@ -26,7 +26,6 @@ ** ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVector> void testErase() { @@ -55,4 +54,4 @@ int main() // testErase(); testInsert(); return 0; -}
\ No newline at end of file +} diff --git a/tests/manual/corelib/tools/qset/main.cpp b/tests/manual/corelib/tools/qset/main.cpp index 1066e53e7d..701c8889db 100644 --- a/tests/manual/corelib/tools/qset/main.cpp +++ b/tests/manual/corelib/tools/qset/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QSet> void testErase() diff --git a/tests/manual/corelib/tools/qvarlengtharray/main.cpp b/tests/manual/corelib/tools/qvarlengtharray/main.cpp index 8580d97a36..0544bb0c4b 100644 --- a/tests/manual/corelib/tools/qvarlengtharray/main.cpp +++ b/tests/manual/corelib/tools/qvarlengtharray/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVarLengthArray> void testErase() diff --git a/tests/manual/corelib/tools/qvector/main.cpp b/tests/manual/corelib/tools/qvector/main.cpp index e3dc89b149..1b35123f15 100644 --- a/tests/manual/corelib/tools/qvector/main.cpp +++ b/tests/manual/corelib/tools/qvector/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVector> void testErase() diff --git a/tests/manual/diaglib/debugproxystyle.cpp b/tests/manual/diaglib/debugproxystyle.cpp index ed35af5962..809613cd1d 100644 --- a/tests/manual/diaglib/debugproxystyle.cpp +++ b/tests/manual/diaglib/debugproxystyle.cpp @@ -68,8 +68,8 @@ QDebug operator<<(QDebug debug, const QStyleOption *option) } else { debug << "QStyleOption("; } - debug << "rect=" << option->rect.width() << 'x' << option->rect.height() - << forcesign << option->rect.x() << option->rect.y() << noforcesign; + debug << "rect=" << option->rect.width() << 'x' << option->rect.height() << Qt::forcesign + << option->rect.x() << option->rect.y() << Qt::noforcesign; if (option->state != QStyle::State_None) debug << ", state=" << option->state; #if QT_VERSION >= 0x050000 diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri index b57ee75841..ace9caecc6 100644 --- a/tests/manual/diaglib/diaglib.pri +++ b/tests/manual/diaglib/diaglib.pri @@ -17,20 +17,8 @@ win32:!winrt: { SOURCES += $$PWD/nativewindowdump.cpp } -greaterThan(QT_MAJOR_VERSION, 4) { - QT += gui-private core-private - contains(QT, widgets) { - HEADERS += \ - $$PWD/qwidgetdump.h \ - $$PWD/debugproxystyle.h \ - $$PWD/logwidget.h - - SOURCES += \ - $$PWD/qwidgetdump.cpp \ - $$PWD/debugproxystyle.cpp \ - $$PWD/logwidget.cpp - } -} else { +QT += gui-private core-private +contains(QT, widgets) { HEADERS += \ $$PWD/qwidgetdump.h \ $$PWD/debugproxystyle.h \ @@ -40,14 +28,17 @@ greaterThan(QT_MAJOR_VERSION, 4) { $$PWD/qwidgetdump.cpp \ $$PWD/debugproxystyle.cpp \ $$PWD/logwidget.cpp + QT += widgets-private } contains(QT, opengl) { -HEADERS += \ - $$PWD/glinfo.h + HEADERS += \ + $$PWD/glinfo.h -SOURCES += \ - $$PWD/glinfo.cpp + SOURCES += \ + $$PWD/glinfo.cpp + + QT += opengl } DEFINES += QT_DIAG_LIB diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index 5a2966021b..926d2aaf35 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.cpp @@ -86,14 +86,16 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, formatWidgetClass(str, w); str << ' ' << (w->isVisible() ? "[visible] " : "[hidden] "); if (const WId nativeWinId = w->internalWinId()) - str << "[native: " << hex << showbase << nativeWinId << dec << noshowbase << "] "; + str << "[native: " << Qt::hex << Qt::showbase << nativeWinId << Qt::dec << Qt::noshowbase + << "] "; if (w->isWindow()) str << "[top] "; str << (w->testAttribute(Qt::WA_Mapped) ? "[mapped] " : "[not mapped] "); if (w->testAttribute(Qt::WA_DontCreateNativeAncestors)) str << "[NoNativeAncestors] "; if (const int states = w->windowState()) - str << "windowState=" << hex << showbase << states << dec << noshowbase << ' '; + str << "windowState=" << Qt::hex << Qt::showbase << states << Qt::dec << Qt::noshowbase + << ' '; formatRect(str, w->geometry()); if (w->isWindow()) { str << ' ' << w->logicalDpiX() << "DPI"; diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp index 381b683359..2be26ff142 100644 --- a/tests/manual/diaglib/qwindowdump.cpp +++ b/tests/manual/diaglib/qwindowdump.cpp @@ -61,8 +61,8 @@ void formatObject(QTextStream &str, const QObject *o) void formatRect(QTextStream &str, const QRect &geom) { - str << geom.width() << 'x' << geom.height() - << forcesign << geom.x() << geom.y() << noforcesign; + str << geom.width() << 'x' << geom.height() << Qt::forcesign << geom.x() << geom.y() + << Qt::noforcesign; } #define debugType(s, type, typeConstant) \ @@ -75,7 +75,7 @@ if (flags & flagConstant) \ void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) { - str << showbase << hex << unsigned(flags) << dec << noshowbase; + str << Qt::showbase << Qt::hex << unsigned(flags) << Qt::dec << Qt::noshowbase; const Qt::WindowFlags windowType = flags & Qt::WindowType_Mask; debugFlag(str, flags, Qt::Window) debugType(str, windowType, Qt::Dialog) @@ -123,7 +123,8 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option formatObject(str, w); str << ' ' << (w->isVisible() ? "[visible] " : "[hidden] "); if (const WId nativeWinId = pw ? pw->winId() : WId(0)) - str << "[native: " << hex << showbase << nativeWinId << dec << noshowbase << "] "; + str << "[native: " << Qt::hex << Qt::showbase << nativeWinId << Qt::dec << Qt::noshowbase + << "] "; if (w->isTopLevel()) str << "[top] "; if (w->isExposed()) diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp index 383ec4edb0..33455a2a56 100644 --- a/tests/manual/diaglib/textdump.cpp +++ b/tests/manual/diaglib/textdump.cpp @@ -408,8 +408,8 @@ struct FormattingContext static void formatCharacter(QTextStream &str, const QChar &qc, FormattingContext &context) { const ushort unicode = qc.unicode(); - str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << uppercasedigits << hex << unicode - << dec << qSetFieldWidth(0) << ' '; + str << "U+" << qSetFieldWidth(4) << qSetPadChar('0') << Qt::uppercasedigits << Qt::hex + << unicode << Qt::dec << qSetFieldWidth(0) << ' '; const EnumLookup *specialChar = enumLookup(unicode, specialCharactersEnumLookup, sizeof(specialCharactersEnumLookup) / sizeof(EnumLookup)); if (specialChar) @@ -477,7 +477,7 @@ QString dumpTextAsCode(const QString &text) { QString result; QTextStream str(&result); - str << " QString result;\n" << hex << showbase; + str << " QString result;\n" << Qt::hex << Qt::showbase; for (QChar c : text) str << " result += QChar(" << c.unicode() << ");\n"; str << '\n'; diff --git a/tests/manual/dialogs/dialogs.pro b/tests/manual/dialogs/dialogs.pro index d765b8cf05..1beedc251e 100644 --- a/tests/manual/dialogs/dialogs.pro +++ b/tests/manual/dialogs/dialogs.pro @@ -1,9 +1,5 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets - qtHaveModule(printsupport): QT += printsupport -} +QT += core gui widgets +qtHaveModule(printsupport): QT += printsupport TARGET = dialogs TEMPLATE = app diff --git a/tests/manual/dialogs/messageboxpanel.cpp b/tests/manual/dialogs/messageboxpanel.cpp index 07b387f988..6a305523ea 100644 --- a/tests/manual/dialogs/messageboxpanel.cpp +++ b/tests/manual/dialogs/messageboxpanel.cpp @@ -39,6 +39,8 @@ #include <QLineEdit> #include <QLabel> #include <QCheckBox> +#include <QRegularExpressionValidator> +#include <QRegularExpression> MessageBoxPanel::MessageBoxPanel(QWidget *parent) : QWidget(parent) ,m_iconComboBox(new QComboBox) @@ -80,7 +82,7 @@ MessageBoxPanel::MessageBoxPanel(QWidget *parent) : QWidget(parent) // buttons mask optionsLayout->addWidget(new QLabel(QString::fromLatin1("Message box button mask (in hex)"))); - m_validator = new QRegExpValidator(QRegExp("0[xX]?[0-9a-fA-F]+"), this); + m_validator = new QRegularExpressionValidator(QRegularExpression("0[xX]?[0-9a-fA-F]+"), this); m_buttonsMask->setMaxLength(10); m_buttonsMask->setValidator(m_validator); m_buttonsMask->setText(QString::fromLatin1("0x00300400")); diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp index b7447e3d64..dcd8b43bf3 100644 --- a/tests/manual/dialogs/printdialogpanel.cpp +++ b/tests/manual/dialogs/printdialogpanel.cpp @@ -190,7 +190,8 @@ QTextStream &operator<<(QTextStream &s, const QSizeF &size) QTextStream &operator<<(QTextStream &s, const QRectF &rect) { - s << rect.width() << 'x' << rect.height() << forcesign << rect.x() << rect.y() << noforcesign; + s << rect.width() << 'x' << rect.height() << Qt::forcesign << rect.x() << rect.y() + << Qt::noforcesign; return s; } diff --git a/tests/manual/gestures/graphicsview/graphicsview.pro b/tests/manual/gestures/graphicsview/graphicsview.pro index 9ecd0b372f..a20c4b3948 100644 --- a/tests/manual/gestures/graphicsview/graphicsview.pro +++ b/tests/manual/gestures/graphicsview/graphicsview.pro @@ -1,5 +1,7 @@ QT += widgets +TARGET = tst_manual_graphicsview + SOURCES += main.cpp \ imageitem.cpp \ gestures.cpp \ diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp index 0d4d3beef7..c025f251a2 100644 --- a/tests/manual/highdpi/main.cpp +++ b/tests/manual/highdpi/main.cpp @@ -66,7 +66,7 @@ static QTextStream &operator<<(QTextStream &str, const QRect &r) { - str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign; + str << r.width() << 'x' << r.height() << Qt::forcesign << r.x() << r.y() << Qt::noforcesign; return str; } diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 42f9878e44..de13bc799e 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -67,8 +67,4 @@ qtConfig(opengl) { win32: SUBDIRS -= network_remote_stresstest network_stresstest -lessThan(QT_MAJOR_VERSION, 5): SUBDIRS -= bearerex lance qnetworkaccessmanager/qget qmimedatabase qnetworkreply \ -qpainfo qscreen socketengine xembed-raster xembed-widgets windowtransparency \ -embeddedintoforeignwindow foreignwindows - qtConfig(vulkan): SUBDIRS += qvulkaninstance diff --git a/tests/manual/qcursor/childwidget/childwidget.pro b/tests/manual/qcursor/childwidget/childwidget.pro index 9ca41c5b4f..9492ec2280 100644 --- a/tests/manual/qcursor/childwidget/childwidget.pro +++ b/tests/manual/qcursor/childwidget/childwidget.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = childwidget +TARGET = tst_manual_childwidget INCLUDEPATH += . QT += widgets diff --git a/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro index 3a8fc25b33..b0a5a75a67 100644 --- a/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro +++ b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro @@ -1,6 +1,5 @@ TEMPLATE = app -QT = core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private core-private widgets +QT = core gui gui-private core-private widgets CONFIG -= app_bundle SOURCES += main.cpp win32: LIBS += -lUser32 diff --git a/tests/manual/qdesktopservices/qdesktopservices.pro b/tests/manual/qdesktopservices/qdesktopservices.pro index baa3c325ff..d2c5703870 100644 --- a/tests/manual/qdesktopservices/qdesktopservices.pro +++ b/tests/manual/qdesktopservices/qdesktopservices.pro @@ -1,6 +1,6 @@ QT += testlib -TARGET = tst_qdesktopservices +TARGET = tst_manual_qdesktopservices CONFIG += cmdline TEMPLATE = app diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp index 5b670a51e2..d67d76699c 100644 --- a/tests/manual/qhttpnetworkconnection/main.cpp +++ b/tests/manual/qhttpnetworkconnection/main.cpp @@ -58,7 +58,7 @@ void tst_qhttpnetworkconnection::bigRemoteFile() QVERIFY(!QTestEventLoop::instance().timeout()); size = reply->size(); delete reply; - qDebug() << "Finished!" << endl; + qDebug() << "Finished!" << Qt::endl; qDebug() << "Time:" << t.elapsed() << "msec"; qDebug() << "Bytes:" << size; qDebug() << "Speed:" << (size / qreal(1024)) / (t.elapsed() / qreal(1000)) << "KB/sec"; diff --git a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro index 62838785d6..f6763e434d 100644 --- a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = tst_qhttpnetworkconnection +TARGET = tst_manual_qhttpnetworkconnection QT -= gui QT += network testlib diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.cpp b/tests/manual/qnetworkaccessmanager/qget/qget.cpp index 639506af63..14bdb589ff 100644 --- a/tests/manual/qnetworkaccessmanager/qget/qget.cpp +++ b/tests/manual/qnetworkaccessmanager/qget/qget.cpp @@ -39,33 +39,41 @@ void printShortUsage() { - qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl - << "Get one or more urls using QNetworkAccessManager" << endl - << "--help to display detailed usage" << endl; + qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << Qt::endl + << "Get one or more urls using QNetworkAccessManager" << Qt::endl + << "--help to display detailed usage" << Qt::endl; } void printUsage() { - qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl - << "Get one or more urls using QNetworkAccessManager" << endl + qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << Qt::endl + << "Get one or more urls using QNetworkAccessManager" << Qt::endl << "Options:" - << "--help This message" << endl - << "--user=<username> Set username to use for authentication" << endl - << "--password=<password> Set password to use for authentication" << endl - << "--proxy-user=<username> Set username to use for proxy authentication" << endl - << "--proxy-password=<password> Set password to use for proxy authentication" << endl - << "--proxy=on Use system proxy (default)" << endl - << "--proxy=off Don't use system proxy" << endl - << "--proxy=<host:port>[,type] Use specified proxy" << endl - << " ,http HTTP proxy (default)" << endl - << " ,socks SOCKS5 proxy" << endl - << " ,ftp FTP proxy" << endl - << " ,httpcaching HTTP caching proxy (no CONNECT method)" << endl - << "--headers=filename Set request headers from file contents" << endl - << "--post=filename upload the file to the next url using HTTP POST" << endl - << "--put=filename upload the file to the next url using HTTP PUT" << endl - << "--content-type=<MIME> set content-type header for upload" << endl - << "--serial don't run requests in parallel" << endl; + << "--help This message" << Qt::endl + << "--user=<username> Set username to use for authentication" + << Qt::endl + << "--password=<password> Set password to use for authentication" + << Qt::endl + << "--proxy-user=<username> Set username to use for proxy authentication" + << Qt::endl + << "--proxy-password=<password> Set password to use for proxy authentication" + << Qt::endl + << "--proxy=on Use system proxy (default)" << Qt::endl + << "--proxy=off Don't use system proxy" << Qt::endl + << "--proxy=<host:port>[,type] Use specified proxy" << Qt::endl + << " ,http HTTP proxy (default)" << Qt::endl + << " ,socks SOCKS5 proxy" << Qt::endl + << " ,ftp FTP proxy" << Qt::endl + << " ,httpcaching HTTP caching proxy (no CONNECT method)" + << Qt::endl + << "--headers=filename Set request headers from file contents" + << Qt::endl + << "--post=filename upload the file to the next url using HTTP POST" + << Qt::endl + << "--put=filename upload the file to the next url using HTTP PUT" + << Qt::endl + << "--content-type=<MIME> set content-type header for upload" << Qt::endl + << "--serial don't run requests in parallel" << Qt::endl; } int main(int argc, char *argv[]) diff --git a/tests/manual/qnetworkconfiguration/qnetworkconfiguration.pro b/tests/manual/qnetworkconfiguration/qnetworkconfiguration.pro index 25ef41b92a..13c229e885 100644 --- a/tests/manual/qnetworkconfiguration/qnetworkconfiguration.pro +++ b/tests/manual/qnetworkconfiguration/qnetworkconfiguration.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = tst_qnetworkconfiguration +TARGET = tst_manual_qnetworkconfiguration QT -= gui QT += network testlib diff --git a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro index 8f9314cc96..072b330894 100644 --- a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro +++ b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = tst_qnetworkconfigurationmanager +TARGET = tst_manual_qnetworkconfigurationmanager QT -= gui QT += network testlib diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index afac7a7095..01bd30a854 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -58,9 +58,6 @@ private slots: void setSslConfiguration_data(); void setSslConfiguration(); void uploadToFacebook(); - void spdy_data(); - void spdy(); - void spdyMultipleRequestsPerHost(); void proxyAuthentication_data(); void proxyAuthentication(); void authentication(); @@ -290,126 +287,6 @@ void tst_qnetworkreply::uploadToFacebook() } } -void tst_qnetworkreply::spdy_data() -{ - QTest::addColumn<QString>("host"); - QTest::addColumn<bool>("setAttribute"); - QTest::addColumn<bool>("enabled"); - QTest::addColumn<QByteArray>("expectedProtocol"); - - QList<QString> hosts = QList<QString>() - << QStringLiteral("www.google.com") // sends SPDY and 30x redirect - << QStringLiteral("www.google.de") // sends SPDY and 200 OK - << QStringLiteral("mail.google.com") // sends SPDY and 200 OK - << QStringLiteral("www.youtube.com") // sends SPDY and 200 OK - << QStringLiteral("www.dropbox.com") // no SPDY, but NPN which selects HTTP - << QStringLiteral("www.facebook.com") // sends SPDY and 200 OK - << QStringLiteral("graph.facebook.com") // sends SPDY and 200 OK - << QStringLiteral("www.twitter.com") // sends SPDY and 30x redirect - << QStringLiteral("twitter.com") // sends SPDY and 200 OK - << QStringLiteral("api.twitter.com"); // sends SPDY and 200 OK - - foreach (const QString &host, hosts) { - QByteArray tag = host.toLocal8Bit(); - tag.append("-not-used"); - QTest::newRow(tag) - << QStringLiteral("https://") + host - << false - << false - << QByteArray(); - - tag = host.toLocal8Bit(); - tag.append("-disabled"); - QTest::newRow(tag) - << QStringLiteral("https://") + host - << true - << false - << QByteArray(); - - if (host != QStringLiteral("api.twitter.com")) { // they don't offer an API over HTTP - tag = host.toLocal8Bit(); - tag.append("-no-https-url"); - QTest::newRow(tag) - << QStringLiteral("http://") + host - << true - << true - << QByteArray(); - } - -#ifndef QT_NO_OPENSSL - tag = host.toLocal8Bit(); - tag.append("-enabled"); - QTest::newRow(tag) - << QStringLiteral("https://") + host - << true - << true - << (host == QStringLiteral("www.dropbox.com") - ? QByteArray(QSslConfiguration::NextProtocolHttp1_1) - : QByteArray(QSslConfiguration::NextProtocolSpdy3_0)); -#endif // QT_NO_OPENSSL - } -} - -void tst_qnetworkreply::spdy() -{ -#if defined(QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) && OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) - - m_manager.clearAccessCache(); - - QFETCH(QString, host); - QUrl url(host); - QNetworkRequest request(url); - - QFETCH(bool, setAttribute); - QFETCH(bool, enabled); - if (setAttribute) { - request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, QVariant(enabled)); - } - - QNetworkReply *reply = m_manager.get(request); - QObject::connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); - - QSignalSpy metaDataChangedSpy(reply, SIGNAL(metaDataChanged())); - QSignalSpy readyReadSpy(reply, SIGNAL(readyRead())); - QSignalSpy finishedSpy(reply, SIGNAL(finished())); - QSignalSpy finishedManagerSpy(&m_manager, SIGNAL(finished(QNetworkReply*))); - - QTestEventLoop::instance().enterLoop(15); - QVERIFY(!QTestEventLoop::instance().timeout()); - - QFETCH(QByteArray, expectedProtocol); - - bool expectedSpdyUsed = (expectedProtocol == QSslConfiguration::NextProtocolSpdy3_0); - QCOMPARE(reply->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), expectedSpdyUsed); - - QCOMPARE(metaDataChangedSpy.count(), 1); - QCOMPARE(finishedSpy.count(), 1); - QCOMPARE(finishedManagerSpy.count(), 1); - - QUrl redirectUrl = reply->header(QNetworkRequest::LocationHeader).toUrl(); - QByteArray content = reply->readAll(); - - int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - QVERIFY(statusCode >= 200 && statusCode < 500); - if (statusCode == 200 || statusCode >= 400) { - QVERIFY(readyReadSpy.count() > 0); - QVERIFY(!content.isEmpty()); - } else if (statusCode >= 300 && statusCode < 400) { - QVERIFY(!redirectUrl.isEmpty()); - } - - QSslConfiguration::NextProtocolNegotiationStatus expectedStatus = - expectedProtocol.isNull() ? QSslConfiguration::NextProtocolNegotiationNone - : QSslConfiguration::NextProtocolNegotiationNegotiated; - QCOMPARE(reply->sslConfiguration().nextProtocolNegotiationStatus(), - expectedStatus); - - QCOMPARE(reply->sslConfiguration().nextNegotiatedProtocol(), expectedProtocol); -#else - QSKIP("Qt built withouth OpenSSL, or the OpenSSL version is too old"); -#endif // defined(QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) ... -} - void tst_qnetworkreply::spdyReplyFinished() { static int finishedCount = 0; @@ -419,85 +296,6 @@ void tst_qnetworkreply::spdyReplyFinished() QTestEventLoop::instance().exitLoop(); } -void tst_qnetworkreply::spdyMultipleRequestsPerHost() -{ -#if defined(QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) && OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) - - QList<QNetworkRequest> requests; - requests - << QNetworkRequest(QUrl("https://www.facebook.com")) - << QNetworkRequest(QUrl("https://www.facebook.com/images/fb_icon_325x325.png")) - - << QNetworkRequest(QUrl("https://www.google.de")) - << QNetworkRequest(QUrl("https://www.google.de/preferences?hl=de")) - << QNetworkRequest(QUrl("https://www.google.de/intl/de/policies/?fg=1")) - << QNetworkRequest(QUrl("https://www.google.de/intl/de/about.html?fg=1")) - << QNetworkRequest(QUrl("https://www.google.de/services/?fg=1")) - << QNetworkRequest(QUrl("https://www.google.de/intl/de/ads/?fg=1")) - - << QNetworkRequest(QUrl("https://i1.ytimg.com/li/tnHdj3df7iM/default.jpg")) - << QNetworkRequest(QUrl("https://i1.ytimg.com/li/7Dr1BKwqctY/default.jpg")) - << QNetworkRequest(QUrl("https://i1.ytimg.com/li/hfZhJdhTqX8/default.jpg")) - << QNetworkRequest(QUrl("https://i1.ytimg.com/vi/14Nprh8163I/hqdefault.jpg")) - ; - QList<QNetworkReply *> replies; - QList<QSignalSpy *> metaDataChangedSpies; - QList<QSignalSpy *> readyReadSpies; - QList<QSignalSpy *> finishedSpies; - - QSignalSpy finishedManagerSpy(&m_manager, SIGNAL(finished(QNetworkReply*))); - - foreach (QNetworkRequest request, requests) { - request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, true); - QNetworkReply *reply = m_manager.get(request); - QObject::connect(reply, SIGNAL(finished()), this, SLOT(spdyReplyFinished())); - replies << reply; - QSignalSpy *metaDataChangedSpy = new QSignalSpy(reply, SIGNAL(metaDataChanged())); - metaDataChangedSpies << metaDataChangedSpy; - QSignalSpy *readyReadSpy = new QSignalSpy(reply, SIGNAL(readyRead())); - readyReadSpies << readyReadSpy; - QSignalSpy *finishedSpy = new QSignalSpy(reply, SIGNAL(finished())); - finishedSpies << finishedSpy; - } - - QCOMPARE(requests.count(), replies.count()); - - QTestEventLoop::instance().enterLoop(15); - QVERIFY(!QTestEventLoop::instance().timeout()); - - QCOMPARE(finishedManagerSpy.count(), requests.count()); - - for (int a = 0; a < replies.count(); ++a) { - - QCOMPARE(replies.at(a)->sslConfiguration().nextProtocolNegotiationStatus(), - QSslConfiguration::NextProtocolNegotiationNegotiated); - QCOMPARE(replies.at(a)->sslConfiguration().nextNegotiatedProtocol(), - QByteArray(QSslConfiguration::NextProtocolSpdy3_0)); - - QCOMPARE(replies.at(a)->error(), QNetworkReply::NoError); - QCOMPARE(replies.at(a)->attribute(QNetworkRequest::SpdyWasUsedAttribute).toBool(), true); - QCOMPARE(replies.at(a)->attribute(QNetworkRequest::ConnectionEncryptedAttribute).toBool(), true); - QCOMPARE(replies.at(a)->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200); - - QByteArray content = replies.at(a)->readAll(); - QVERIFY(content.count() > 0); - - QCOMPARE(metaDataChangedSpies.at(a)->count(), 1); - metaDataChangedSpies.at(a)->deleteLater(); - - QCOMPARE(finishedSpies.at(a)->count(), 1); - finishedSpies.at(a)->deleteLater(); - - QVERIFY(readyReadSpies.at(a)->count() > 0); - readyReadSpies.at(a)->deleteLater(); - - replies.at(a)->deleteLater(); - } -#else - QSKIP("Qt built withouth OpenSSL, or the OpenSSL version is too old"); -#endif // defined(QT_BUILD_INTERNAL) && !defined(QT_NO_SSL) ... -} - void tst_qnetworkreply::proxyAuthentication_data() { QTest::addColumn<QUrl>("url"); @@ -586,7 +384,7 @@ void tst_qnetworkreply::npnWithEmptyList() // QTBUG-40714 QUrl url(QStringLiteral("https://www.ossifrage.net/")); QNetworkRequest request(url); - request.setAttribute(QNetworkRequest::SpdyAllowedAttribute, QVariant(true)); + request.setAttribute(QNetworkRequest::Http2AllowedAttribute, QVariant(true)); QNetworkReply *reply = m_manager.get(request); QObject::connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); diff --git a/tests/manual/qnetworkreply/qnetworkreply.pro b/tests/manual/qnetworkreply/qnetworkreply.pro index eddcbdff1d..2457acd749 100644 --- a/tests/manual/qnetworkreply/qnetworkreply.pro +++ b/tests/manual/qnetworkreply/qnetworkreply.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = tst_qnetworkreply +TARGET = tst_manual_qnetworkreply QT -= gui QT += core-private network network-private testlib diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp index 0728d66bf9..ab92216d22 100644 --- a/tests/manual/qscreen/main.cpp +++ b/tests/manual/qscreen/main.cpp @@ -192,15 +192,15 @@ static inline QString msgScreenChange(const QWidget *w, const QScreen *oldScreen if (!newScreen) { result = QLatin1String("Screen changed --> null"); } else if (!oldScreen) { - QTextStream(&result) << "Screen changed null --> \"" - << newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: " - << geometry.width() << 'x' << geometry.height() << forcesign << geometry.x() - << geometry.y() << '.'; + QTextStream(&result) << "Screen changed null --> \"" << newScreen->name() << "\" at " + << pos.x() << ',' << pos.y() << " geometry: " << geometry.width() + << 'x' << geometry.height() << Qt::forcesign << geometry.x() + << geometry.y() << '.'; } else { QTextStream(&result) << "Screen changed \"" << oldScreen->name() << "\" --> \"" - << newScreen->name() << "\" at " << pos.x() << ',' << pos.y() << " geometry: " - << geometry.width() << 'x' << geometry.height() << forcesign << geometry.x() - << geometry.y() << '.'; + << newScreen->name() << "\" at " << pos.x() << ',' << pos.y() + << " geometry: " << geometry.width() << 'x' << geometry.height() + << Qt::forcesign << geometry.x() << geometry.y() << '.'; } return result; } diff --git a/tests/manual/qssloptions/main.cpp b/tests/manual/qssloptions/main.cpp index 0f06071b41..cc65c57f33 100644 --- a/tests/manual/qssloptions/main.cpp +++ b/tests/manual/qssloptions/main.cpp @@ -37,13 +37,13 @@ int main(int argc, char **argv) if (argc < 3) { QTextStream out(stdout); - out << "Usage: " << argv[0] << " host port [options]" << endl; - out << "The options can be one or more of the following:" << endl; - out << "enable_empty_fragments" << endl; - out << "disable_session_tickets" << endl; - out << "disable_compression" << endl; - out << "disable_sni" << endl; - out << "enable_unsafe_reneg" << endl; + out << "Usage: " << argv[0] << " host port [options]" << Qt::endl; + out << "The options can be one or more of the following:" << Qt::endl; + out << "enable_empty_fragments" << Qt::endl; + out << "disable_session_tickets" << Qt::endl; + out << "disable_compression" << Qt::endl; + out << "disable_sni" << Qt::endl; + out << "enable_unsafe_reneg" << Qt::endl; return 1; } diff --git a/tests/manual/qsslsocket/qsslsocket.pro b/tests/manual/qsslsocket/qsslsocket.pro index c297d887ba..511d31898f 100644 --- a/tests/manual/qsslsocket/qsslsocket.pro +++ b/tests/manual/qsslsocket/qsslsocket.pro @@ -3,4 +3,4 @@ CONFIG += testcase SOURCES += main.cpp QT = core network testlib -TARGET = tst_qsslsocket +TARGET = tst_manual_qsslsocket diff --git a/tests/manual/qtexteditlist/qtexteditlist.pro b/tests/manual/qtexteditlist/qtexteditlist.pro index 953333f3ee..972e054445 100644 --- a/tests/manual/qtexteditlist/qtexteditlist.pro +++ b/tests/manual/qtexteditlist/qtexteditlist.pro @@ -1,6 +1,6 @@ #This project can be used to verify QTBUG-5111 case. QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += widgets TARGET = qtexteditlist TEMPLATE = app SOURCES += main.cpp widget.cpp diff --git a/tests/manual/qtexttableborders/qtexttableborders.pro b/tests/manual/qtexttableborders/qtexttableborders.pro index 7e454f978d..3805ac6ed0 100644 --- a/tests/manual/qtexttableborders/qtexttableborders.pro +++ b/tests/manual/qtexttableborders/qtexttableborders.pro @@ -1,7 +1,6 @@ #This project can be used to verify QTBUG-36152 case. -QT += core gui printsupport +QT += core gui printsupport widgets CONFIG += c++11 -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qtexttableborders TEMPLATE = app SOURCES += main.cpp widget.cpp diff --git a/tests/manual/qtouchevent/qtouchevent.pro b/tests/manual/qtouchevent/qtouchevent.pro index 81384eaf24..4ba921d301 100644 --- a/tests/manual/qtouchevent/qtouchevent.pro +++ b/tests/manual/qtouchevent/qtouchevent.pro @@ -1,5 +1,4 @@ -QT += testlib -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += testlib widgets SOURCES = main.cpp \ touchwidget.cpp FORMS += form.ui diff --git a/tests/manual/repaint/mainwindow/mainwindow.pro b/tests/manual/repaint/mainwindow/mainwindow.pro index f20e5fe402..419436032c 100644 --- a/tests/manual/repaint/mainwindow/mainwindow.pro +++ b/tests/manual/repaint/mainwindow/mainwindow.pro @@ -1,3 +1,4 @@ +TARGET = tst_manual_mainwindow QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/scrollarea/scrollarea.pro b/tests/manual/repaint/scrollarea/scrollarea.pro index f20e5fe402..deff158cce 100644 --- a/tests/manual/repaint/scrollarea/scrollarea.pro +++ b/tests/manual/repaint/scrollarea/scrollarea.pro @@ -1,3 +1,4 @@ QT += widgets +TARGET = tst_manual_scrollarea HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/toplevel/toplevel.pro b/tests/manual/repaint/toplevel/toplevel.pro index a881c24f56..d142fd19bb 100644 --- a/tests/manual/repaint/toplevel/toplevel.pro +++ b/tests/manual/repaint/toplevel/toplevel.pro @@ -1,5 +1,6 @@ CONFIG += console QT += widgets +TARGET = tst_manual_toplevel HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp index a244230a22..8572e18955 100644 --- a/tests/manual/touch/main.cpp +++ b/tests/manual/touch/main.cpp @@ -526,7 +526,7 @@ void MainWindow::updateScreenLabel() const QRect geometry = screen->geometry(); const qreal dpr = screen->devicePixelRatio(); str << '"' << screen->name() << "\" " << geometry.width() << 'x' << geometry.height() - << forcesign << geometry.x() << geometry.y() << noforcesign; + << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign; if (!qFuzzyCompare(dpr, qreal(1))) str << ", dpr=" << dpr; m_screenLabel->setText(text); diff --git a/tests/manual/touch/touch.pro b/tests/manual/touch/touch.pro index fcb3c47f43..08e3fdcd71 100644 --- a/tests/manual/touch/touch.pro +++ b/tests/manual/touch/touch.pro @@ -1,5 +1,4 @@ TEMPLATE = app -QT = core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT = core gui widgets CONFIG -= app_bundle SOURCES += main.cpp diff --git a/tests/manual/unc/unc.pro b/tests/manual/unc/unc.pro index 977bd0c177..a1536a03db 100644 --- a/tests/manual/unc/unc.pro +++ b/tests/manual/unc/unc.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TEMPLATE = app diff --git a/tests/manual/widgetgrab/widgetgrab.pro b/tests/manual/widgetgrab/widgetgrab.pro index d206fb1df1..c354711197 100644 --- a/tests/manual/widgetgrab/widgetgrab.pro +++ b/tests/manual/widgetgrab/widgetgrab.pro @@ -1,9 +1,5 @@ -QT += core gui +QT += core gui widgets TARGET = widgetgrab TEMPLATE = app SOURCES += main.cpp - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} diff --git a/tests/manual/widgets/styles/styles.pro b/tests/manual/widgets/styles/styles.pro index d302ae0691..1830e21705 100644 --- a/tests/manual/widgets/styles/styles.pro +++ b/tests/manual/widgets/styles/styles.pro @@ -1,5 +1,6 @@ TEMPLATE = app QT = widgets +TARGET = tst_manual_styles CONFIG += cmdline CONFIG += c++11 diff --git a/tests/manual/widgets/widgets.pro b/tests/manual/widgets/widgets.pro index e3942a49e9..03aaa880b8 100644 --- a/tests/manual/widgets/widgets.pro +++ b/tests/manual/widgets/widgets.pro @@ -1,3 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = itemviews qgraphicsview kernel widgets -greaterThan(QT_MAJOR_VERSION, 4): SUBDIRS += styles +SUBDIRS = itemviews qgraphicsview kernel widgets styles diff --git a/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro b/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro index 69fbea3834..408dab6482 100644 --- a/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro +++ b/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro @@ -4,9 +4,7 @@ # #------------------------------------------------- -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = BigMenuCreator TEMPLATE = app diff --git a/tests/manual/windowchildgeometry/windowchildgeometry.pro b/tests/manual/windowchildgeometry/windowchildgeometry.pro index 921acd8a4e..7722547ce7 100644 --- a/tests/manual/windowchildgeometry/windowchildgeometry.pro +++ b/tests/manual/windowchildgeometry/windowchildgeometry.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = windowchildgeometry TEMPLATE = app diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index ef3966830b..893dbc9a41 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.cpp @@ -48,7 +48,8 @@ void PreviewWindow::paintEvent(QPaintEvent *event) static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) { - str << "Window flags: " << hex << showbase << unsigned(flags) << noshowbase << dec << ' '; + str << "Window flags: " << Qt::hex << Qt::showbase << unsigned(flags) << Qt::noshowbase + << Qt::dec << ' '; switch (flags & Qt::WindowType_Mask) { case Qt::Window: str << "Qt::Window"; @@ -125,7 +126,8 @@ static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) static void formatWindowStates(QTextStream &str, Qt::WindowStates states) { - str << "Window states: " << hex << showbase << unsigned(states) << noshowbase << dec << ' '; + str << "Window states: " << Qt::hex << Qt::showbase << unsigned(states) << Qt::noshowbase + << Qt::dec << ' '; if (states & Qt::WindowActive) { str << "Qt::WindowActive "; states &= ~Qt::WindowActive; @@ -150,7 +152,7 @@ static void formatWindowStates(QTextStream &str, Qt::WindowStates states) QTextStream &operator<<(QTextStream &str, const QRect &r) { - str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign; + str << r.width() << 'x' << r.height() << Qt::forcesign << r.x() << r.y() << Qt::noforcesign; return str; } diff --git a/tests/manual/windowflags/windowflags.pro b/tests/manual/windowflags/windowflags.pro index ba0f75b65c..4cd60ae6cf 100644 --- a/tests/manual/windowflags/windowflags.pro +++ b/tests/manual/windowflags/windowflags.pro @@ -1,3 +1,5 @@ +TARGET = tst_manual_windowflags + HEADERS = controllerwindow.h \ previewwindow.h \ controls.h @@ -7,4 +9,4 @@ SOURCES = controllerwindow.cpp \ main.cpp \ controls.cpp -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += widgets diff --git a/tests/manual/windowgeometry/windowgeometry.pro b/tests/manual/windowgeometry/windowgeometry.pro index e717799649..ee99f1950c 100644 --- a/tests/manual/windowgeometry/windowgeometry.pro +++ b/tests/manual/windowgeometry/windowgeometry.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = windowgeometry TEMPLATE = app diff --git a/tests/manual/windowmodality/windowmodality.pro b/tests/manual/windowmodality/windowmodality.pro index b29e939d27..973579c508 100644 --- a/tests/manual/windowmodality/windowmodality.pro +++ b/tests/manual/windowmodality/windowmodality.pro @@ -1,3 +1,3 @@ SOURCES = main.cpp FORMS = widget.ui dialog.ui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport +QT += widgets printsupport diff --git a/tests/manual/xembed-raster/xembed-raster.pro b/tests/manual/xembed-raster/xembed-raster.pro index adaf9c4d25..4c9fee07b8 100644 --- a/tests/manual/xembed-raster/xembed-raster.pro +++ b/tests/manual/xembed-raster/xembed-raster.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET= rasterwindow +TARGET= tst_manual_rasterwindow QT += gui SOURCES += \ diff --git a/tests/manual/xembed-widgets/xembed-widgets.pro b/tests/manual/xembed-widgets/xembed-widgets.pro index e406ee47fd..28d13d5b61 100644 --- a/tests/manual/xembed-widgets/xembed-widgets.pro +++ b/tests/manual/xembed-widgets/xembed-widgets.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET= lineedits +TARGET= tst_manual_lineedits QT += widgets SOURCES += \ |