diff options
author | Liang Qi <liang.qi@qt.io> | 2017-07-04 15:19:36 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-07-04 16:05:53 +0200 |
commit | c2b224a758ce7e6dcf3748444fa8e29ab81904be (patch) | |
tree | 277cb99bf054190c935579142506caa4ec9861dd /tests | |
parent | 10de063ff12cdba07b4620182aced8ed05ee3505 (diff) | |
parent | eaee1209f0ead5be786e81db8aee604ccfea85b0 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/corelib/io/qprocess_unix.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
src/plugins/platforms/xcb/qxcbwindow.cpp
src/widgets/util/util.pri
tests/auto/corelib/thread/qthread/qthread.pro
tests/auto/corelib/thread/qthread/tst_qthread.cpp
Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
Diffstat (limited to 'tests')
46 files changed, 286 insertions, 151 deletions
diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST new file mode 100644 index 0000000000..fe1d5bd968 --- /dev/null +++ b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST @@ -0,0 +1,2 @@ +[deleteChildrenWithRunningGroup] +osx-10.12 diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index 7ad047e8a2..1472ddbb83 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -4,6 +4,12 @@ QT = core-private core testlib qtHaveModule(network): QT += network else: DEFINES += QT_NO_NETWORK +contains(CONFIG, builtin_testdata) { + DEFINES += BUILTIN_TESTDATA +} + +TESTDATA += ../BLACKLIST + TARGET = ../tst_qfile SOURCES = ../tst_qfile.cpp INCLUDEPATH += ../../../../../shared/ diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index f97501e8a6..17497e46b9 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -250,6 +250,9 @@ private slots: void reuseQFile(); private: +#ifdef BUILTIN_TESTDATA + QSharedPointer<QTemporaryDir> m_dataDir; +#endif enum FileType { OpenQFile, OpenFd, @@ -428,8 +431,15 @@ void tst_QFile::initTestCase() QVERIFY(!m_forRenamingFile.isEmpty()); m_twoDotsFile = QFINDTESTDATA("two.dots.file"); QVERIFY(!m_twoDotsFile.isEmpty()); + +#ifndef BUILTIN_TESTDATA m_testFile = QFINDTESTDATA("testfile.txt"); QVERIFY(!m_testFile.isEmpty()); +#else + m_dataDir = QEXTRACTTESTDATA("/"); + QVERIFY2(!m_dataDir.isNull(), qPrintable("Could not extract test data")); + m_testFile = m_dataDir->path() + "/testfile.txt"; +#endif m_resourcesDir = QFINDTESTDATA("resources"); QVERIFY(!m_resourcesDir.isEmpty()); m_noEndOfLineFile = QFINDTESTDATA("noendofline.txt"); diff --git a/tests/auto/corelib/io/qtextstream/BLACKLIST b/tests/auto/corelib/io/qtextstream/BLACKLIST index bc3f118b33..b54b53cd74 100644 --- a/tests/auto/corelib/io/qtextstream/BLACKLIST +++ b/tests/auto/corelib/io/qtextstream/BLACKLIST @@ -1,2 +1,3 @@ [stillOpenWhenAtEnd] windows +winrt diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 50335524d3..3dcfa0b414 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -18,7 +18,8 @@ TESTDATA += \ ../task113817.txt \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ - ../resources + ../resources \ + ../BLACKLIST builtin_testdata { DEFINES += BUILTIN_TESTDATA diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 1cbb7ad19c..7eeaea564f 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3061,11 +3061,7 @@ void tst_QUrl::fromUserInputWithCwd_data() // "." { - const QUrl url = QUrl::fromLocalFile(base -#ifdef Q_OS_WINRT - + QLatin1Char('/') -#endif - ); // fromUserInput cleans the path + const QUrl url = QUrl::fromLocalFile(base); // fromUserInput cleans the path QTest::newRow("dot-in-path") << "." << base << url << url; QTest::newRow("dot-in-dot") << "." << QStringLiteral(".") << url << url; } diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp index 06e2b0ea8c..e17d8ee38b 100644 --- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp +++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp @@ -37,6 +37,7 @@ #include <qtimer.h> #include <qthread.h> +#include <qoperatingsystemversion.h> #if defined Q_OS_UNIX #include <unistd.h> @@ -498,6 +499,9 @@ void tst_QTimer::moveToThread() { #if defined(Q_OS_WIN32) QSKIP("Does not work reliably on Windows :("); +#elif defined(Q_OS_MACOS) + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSSierra) + QSKIP("Does not work reliably on macOS 10.12 (QTBUG-59679)"); #endif QTimer ti1; QTimer ti2; diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 4fccd9f4fc..97fce88f19 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -77,7 +77,7 @@ public: enum MetaEnumTest_Enum0 { MetaEnumTest_Enum0_dummy = 2, MetaEnumTest_Enum0_value = 42, MetaEnsureSignedEnum0 = -1 }; Q_ENUM(MetaEnumTest_Enum0) - enum MetaEnumTest_Enum1 { MetaEnumTest_Enum1_value = 42, MetaEnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 }; + enum MetaEnumTest_Enum1 : qint64 { MetaEnumTest_Enum1_value = 42, MetaEnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 }; Q_ENUM(MetaEnumTest_Enum1) enum MetaEnumTest_Enum3 ENUM_SIZE(qint64) { MetaEnumTest_Enum3_value = -47, MetaEnumTest_Enum3_bigValue = (Q_INT64_C(1) << 56) + 5, MetaEnumTest_Enum3_bigNegValue = -(Q_INT64_C(1) << 56) - 3 }; @@ -4631,7 +4631,7 @@ void tst_QVariant::pairElements() enum EnumTest_Enum0 { EnumTest_Enum0_value = 42, EnumTest_Enum0_negValue = -8 }; Q_DECLARE_METATYPE(EnumTest_Enum0) -enum EnumTest_Enum1 { EnumTest_Enum1_value = 42, EnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 }; +enum EnumTest_Enum1 : qint64 { EnumTest_Enum1_value = 42, EnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 }; Q_DECLARE_METATYPE(EnumTest_Enum1) #if defined(Q_COMPILER_CLASS_ENUM) diff --git a/tests/auto/corelib/thread/qthread/qthread.pro b/tests/auto/corelib/thread/qthread/qthread.pro index 381f6c9e45..37552f1fca 100644 --- a/tests/auto/corelib/thread/qthread/qthread.pro +++ b/tests/auto/corelib/thread/qthread/qthread.pro @@ -4,3 +4,6 @@ QT = core testlib SOURCES = tst_qthread.cpp qtConfig(c++14):CONFIG += c++14 qtConfig(c++1z):CONFIG += c++1z + +INCLUDEPATH += ../../../../shared/ +HEADERS += ../../../../shared/emulationdetector.h diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp index b107cf4b60..27a617ec85 100644 --- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp +++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp @@ -51,6 +51,8 @@ #include <exception> #endif +#include "emulationdetector.h" + class tst_QThread : public QObject { Q_OBJECT @@ -943,6 +945,9 @@ void tst_QThread::adoptMultipleThreadsOverlap() // Disconnects on WinCE void tst_QThread::stressTest() { + if (EmulationDetector::isRunningArmOnX86()) + QSKIP("Qemu uses too much memory for each thread. Test would run out of memory."); + QTime t; t.start(); while (t.elapsed() < one_minute) { diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp index 16a9c03351..93c10d78db 100644 --- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp @@ -1372,7 +1372,7 @@ void tst_QByteArray::toULongLong() QCOMPARE(b, ok); } -static bool checkSize(size_t value, uint min) +static bool checkSize(size_t value, size_t min) { return value >= min && value <= INT_MAX; } diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp index e8f56fc1d3..62dd33131b 100644 --- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp +++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp @@ -593,6 +593,8 @@ namespace QTest { } else { ok = qmake.waitForFinished(); exitCode = qmake.exitCode(); + if (!ok) + qmake.terminate(); std_out += qmake.readAllStandardOutput(); std_err += qmake.readAllStandardError(); diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST index d55c67998d..2303d9380e 100644 --- a/tests/auto/gui/kernel/qguieventloop/BLACKLIST +++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST @@ -1,2 +1,4 @@ [processEvents] osx-10.12 +[testQuitLock] +osx-10.12 diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 2d32876a8d..9ef8699164 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -1644,7 +1644,7 @@ void tst_QWindow::inputReentrancy() QCOMPARE(window.touchReleasedCount, 1); } -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) class TabletTestWindow : public QWindow { public: @@ -1672,7 +1672,7 @@ public: void tst_QWindow::tabletEvents() { -#ifndef QT_NO_TABLETEVENT +#if QT_CONFIG(tabletevent) TabletTestWindow window; window.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize)); qGuiApp->installEventFilter(&window); diff --git a/tests/auto/gui/qopenglconfig/qopenglconfig.pro b/tests/auto/gui/qopenglconfig/qopenglconfig.pro index 9b0175acea..446a960835 100644 --- a/tests/auto/gui/qopenglconfig/qopenglconfig.pro +++ b/tests/auto/gui/qopenglconfig/qopenglconfig.pro @@ -7,4 +7,4 @@ TARGET = tst_qopenglconfig QT += gui-private core-private testlib SOURCES += tst_qopenglconfig.cpp -OTHER_FILES = buglist.json +TESTDATA += buglist.json diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp index 9f77419461..d0686eb01c 100644 --- a/tests/auto/network/access/http2/http2srv.cpp +++ b/tests/auto/network/access/http2/http2srv.cpp @@ -61,7 +61,7 @@ namespace inline bool is_valid_client_stream(quint32 streamID) { // A valid client stream ID is an odd integer number in the range [1, INT_MAX]. - return (streamID & 0x1) && streamID <= std::numeric_limits<qint32>::max(); + return (streamID & 0x1) && streamID <= quint32(std::numeric_limits<qint32>::max()); } void fill_push_header(const HttpHeader &originalRequest, HttpHeader &promisedRequest) diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp index 715fc586cd..d72e92b859 100644 --- a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp +++ b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp @@ -32,16 +32,7 @@ #include <QtNetwork/QDnsLookup> #include <QtNetwork/QHostAddress> -static bool waitForDone(QDnsLookup *lookup) -{ - if (lookup->isFinished()) - return true; - - QObject::connect(lookup, SIGNAL(finished()), - &QTestEventLoop::instance(), SLOT(exitLoop())); - QTestEventLoop::instance().enterLoop(10); - return !QTestEventLoop::instance().timeout(); -} +static const int Timeout = 15000; // 15s class tst_QDnsLookup: public QObject { @@ -231,8 +222,7 @@ void tst_QDnsLookup::lookup() lookup.setType(static_cast<QDnsLookup::Type>(type)); lookup.setName(domain); lookup.lookup(); - QVERIFY(waitForDone(&lookup)); - QVERIFY(lookup.isFinished()); + QTRY_VERIFY_WITH_TIMEOUT(lookup.isFinished(), Timeout); #if defined(Q_OS_ANDROID) if (lookup.errorString() == QStringLiteral("Not yet supported on Android")) @@ -331,8 +321,7 @@ void tst_QDnsLookup::lookupReuse() lookup.setType(QDnsLookup::A); lookup.setName(domainName("a-single")); lookup.lookup(); - QVERIFY(waitForDone(&lookup)); - QVERIFY(lookup.isFinished()); + QTRY_VERIFY_WITH_TIMEOUT(lookup.isFinished(), Timeout); #if defined(Q_OS_ANDROID) if (lookup.errorString() == QStringLiteral("Not yet supported on Android")) @@ -348,8 +337,7 @@ void tst_QDnsLookup::lookupReuse() lookup.setType(QDnsLookup::AAAA); lookup.setName(domainName("aaaa-single")); lookup.lookup(); - QVERIFY(waitForDone(&lookup)); - QVERIFY(lookup.isFinished()); + QTRY_VERIFY_WITH_TIMEOUT(lookup.isFinished(), Timeout); QCOMPARE(int(lookup.error()), int(QDnsLookup::NoError)); QVERIFY(!lookup.hostAddressRecords().isEmpty()); QCOMPARE(lookup.hostAddressRecords().first().name(), domainName("aaaa-single")); @@ -366,8 +354,7 @@ void tst_QDnsLookup::lookupAbortRetry() lookup.setName(domainName("a-single")); lookup.lookup(); lookup.abort(); - QVERIFY(waitForDone(&lookup)); - QVERIFY(lookup.isFinished()); + QTRY_VERIFY_WITH_TIMEOUT(lookup.isFinished(), Timeout); QCOMPARE(int(lookup.error()), int(QDnsLookup::OperationCancelledError)); QVERIFY(lookup.hostAddressRecords().isEmpty()); @@ -375,8 +362,7 @@ void tst_QDnsLookup::lookupAbortRetry() lookup.setType(QDnsLookup::AAAA); lookup.setName(domainName("aaaa-single")); lookup.lookup(); - QVERIFY(waitForDone(&lookup)); - QVERIFY(lookup.isFinished()); + QTRY_VERIFY_WITH_TIMEOUT(lookup.isFinished(), Timeout); #if defined(Q_OS_ANDROID) if (lookup.errorString() == QStringLiteral("Not yet supported on Android")) diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index 7faf0d947c..4f947a5738 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -41,7 +41,7 @@ #include <QNetworkReply> #include <QNetworkRequest> #include <QList> - +#include <QSysInfo> #include <QThread> class tst_QNetworkProxyFactory : public QObject { @@ -416,6 +416,9 @@ public: //regression test for QTBUG-18799 void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread() { + if (QSysInfo::productType() == QLatin1String("windows") && QSysInfo::productVersion() == QLatin1String("7sp1")) { + QSKIP("This test fails by the systemProxyForQuery() call hanging - QTQAINFRA-1200"); + } QUrl url(QLatin1String("http://qt-project.org")); QNetworkProxyQuery query(url); QSPFQThread thread; diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST index 2a32a326d0..60526827bf 100644 --- a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST +++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST @@ -4,3 +4,5 @@ * [serverTest] windows +[downloadBigFile] +windows diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 18da122000..1212ea20e5 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -728,6 +728,10 @@ void tst_QSocks5SocketEngine::downloadBigFile() QTcpSocket socket; qint64 bytesAvailable = 0; + + QElapsedTimer stopWatch; + stopWatch.start(); + connect(&socket, &QAbstractSocket::connected, &QTestEventLoop::instance(), &QTestEventLoop::exitLoop); connect(&socket, &QIODevice::readyRead, @@ -743,10 +747,11 @@ void tst_QSocks5SocketEngine::downloadBigFile() }); connect(&socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), - [&socket] (QAbstractSocket::SocketError errorCode) + [&socket, &stopWatch] (QAbstractSocket::SocketError errorCode) { qWarning().noquote().nospace() << QTest::currentTestFunction() - << ": error " << errorCode << ": " << socket.errorString(); + << ": error " << errorCode << ": " << socket.errorString() + << " (" << stopWatch.elapsed() << "ms)"; }); socket.connectToHost(QtNetworkSettings::serverName(), 80); @@ -763,11 +768,7 @@ void tst_QSocks5SocketEngine::downloadBigFile() QVERIFY(socket.write("\r\n") > 0); QVERIFY(socket.write("\r\n") > 0); - - - QTime stopWatch; - stopWatch.start(); - + stopWatch.restart(); QTestEventLoop::instance().enterLoop(60); if (QTestEventLoop::instance().timeout()) QFAIL("Network operation timed out"); diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp index 22c2e1fbc7..14ede33500 100644 --- a/tests/auto/other/languagechange/tst_languagechange.cpp +++ b/tests/auto/other/languagechange/tst_languagechange.cpp @@ -197,7 +197,7 @@ void tst_languageChange::retranslatability_data() << "QFileDialog::Back" << "QFileDialog::Create New Folder" << "QFileDialog::Detail View" -#ifndef Q_OS_MAC +#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT) << "QFileDialog::File" #endif << "QFileDialog::Files of type:" diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST index 3e68ba0cf0..f1eb038201 100644 --- a/tests/auto/other/macnativeevents/BLACKLIST +++ b/tests/auto/other/macnativeevents/BLACKLIST @@ -21,3 +21,6 @@ osx osx [testMouseDragToNonClientArea] osx +# QTQAINFRA-1292 +[testPushButtonPressRelease] +osx-10.11 ci diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp index eb056475d1..3a6102f2fa 100644 --- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp +++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp @@ -94,7 +94,7 @@ private slots: void customPaperSizeAndMargins(); void customPaperNameSettingBySize(); void customPaperNameSettingByName(); -#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) +#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) void printDialogCompleter(); #endif void testCurrentPage(); @@ -601,7 +601,7 @@ void tst_QPrinter::customPaperSizeAndMargins() } } -#if !defined(QT_NO_COMPLETER) && !defined(QT_NO_FILEDIALOG) +#if !defined(QT_NO_COMPLETER) && QT_CONFIG(filedialog) void tst_QPrinter::printDialogCompleter() { QPrintDialog dialog; diff --git a/tests/auto/tools/moc/namespace.h b/tests/auto/tools/moc/namespace.h index 6e04831589..43d00e82f3 100644 --- a/tests/auto/tools/moc/namespace.h +++ b/tests/auto/tools/moc/namespace.h @@ -74,4 +74,8 @@ namespace FooNamespace { } } +#ifdef Q_MOC_RUN +namespace __identifier("<AtlImplementationDetails>") {} // QTBUG-56634 +#endif + #endif // NAMESPACE_H diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index ac7ba02700..d3bc83fe6d 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -339,7 +339,7 @@ void tst_QDialog::showFullScreen() QVERIFY(dialog.isFullScreen()); QVERIFY(!dialog.isVisible()); - dialog.show(); + dialog.setVisible(true); QVERIFY(dialog.isFullScreen()); QVERIFY(dialog.isVisible()); diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index 0ea9e0259f..4ea0de5ab9 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -349,11 +349,12 @@ void tst_QInputDialog::taskQTBUG_54693_crashWhenParentIsDeletedWhileDialogIsOpen } // getItem - for (int editable = false; editable <= true; ++editable) { + for (int editable = 0; editable < 2; ++editable) { QAutoPointer<SelfDestructParent> dialog(new SelfDestructParent); bool ok = true; const QString result = QInputDialog::getItem(dialog.get(), "Title", "Label", - QStringList() << "1" << "2", 1, editable, &ok); + QStringList() << "1" << "2", 1, + editable != 0, &ok); QVERIFY(!dialog); QVERIFY(!ok); QCOMPARE(result, QLatin1String("2")); diff --git a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST index a2670e8f36..1789f51507 100644 --- a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST +++ b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST @@ -1,2 +1,2 @@ -[autoShow:50_to_100_fast_0_compat] -osx +[autoShow] +osx ci diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp index 4d289dcb02..a1cb729849 100644 --- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp @@ -52,7 +52,6 @@ private slots: void boundingRect2(); void draw(); void opacity(); - void nestedOpaqueOpacity(); void grayscale(); void colorize(); void drawPixmapItem(); @@ -408,26 +407,6 @@ void tst_QGraphicsEffect::opacity() QCOMPARE(effect->m_opacity, qreal(0.5)); } -void tst_QGraphicsEffect::nestedOpaqueOpacity() -{ - // QTBUG-60231: Nesting widgets with a QGraphicsEffect on a toplevel with - // QGraphicsOpacityEffect caused crashes due to constructing several - // QPainter instances on a device in the fast path for - // QGraphicsOpacityEffect::opacity=1 - QWidget topLevel; - topLevel.setWindowTitle(QTest::currentTestFunction()); - topLevel.resize(QApplication::desktop()->screenGeometry(&topLevel).size() / 8); - QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect; - opacityEffect->setOpacity(1); - topLevel.setGraphicsEffect(opacityEffect); - QWidget *child = new QWidget(&topLevel); - child->resize(topLevel.size() / 2); - QGraphicsDropShadowEffect *childEffect = new QGraphicsDropShadowEffect; - child->setGraphicsEffect(childEffect); - topLevel.show(); - QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); -} - void tst_QGraphicsEffect::grayscale() { if (qApp->desktop()->depth() < 24) diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 65c9938f89..e49cd87941 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -112,7 +112,7 @@ private slots: void resizeEvent_data(); void resizeEvent(); void paintEvent(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(); #endif void sizeHint_data(); @@ -254,7 +254,7 @@ public: int focusOut; }; -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) class WheelWidget : public QWidget { public: @@ -264,7 +264,7 @@ public: bool wheelEventCalled; }; -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) // This will be called before the first test function is executed. // It is only called once. @@ -1297,7 +1297,7 @@ void tst_QGraphicsProxyWidget::paintEvent() } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QGraphicsProxyWidget::wheelEvent() { QGraphicsScene scene; @@ -1321,7 +1321,7 @@ void tst_QGraphicsProxyWidget::wheelEvent() QVERIFY(event.isAccepted()); QVERIFY(wheelWidget->wheelEventCalled); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) Q_DECLARE_METATYPE(Qt::SizeHint) void tst_QGraphicsProxyWidget::sizeHint_data() diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 6abd3f6366..1430911cf0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -199,7 +199,7 @@ private slots: void mapFromScenePoly(); void mapFromScenePath(); void sendEvent(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(); #endif #ifndef QT_NO_CURSOR @@ -2188,7 +2188,7 @@ void tst_QGraphicsView::sendEvent() QCOMPARE(item->events.last(), QEvent::KeyPress); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) class MouseWheelScene : public QGraphicsScene { public: @@ -2245,7 +2245,7 @@ void tst_QGraphicsView::wheelEvent() QCOMPARE(spy.count(), 2); QVERIFY(widget->hasFocus()); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) #ifndef QT_NO_CURSOR void tst_QGraphicsView::cursor() diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index cf8ee310d3..c75c1dc87e 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -180,7 +180,7 @@ private slots: void task191545_dragSelectRows(); void taskQTBUG_5062_spansInconsistency(); void taskQTBUG_4516_clickOnRichTextLabel(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void taskQTBUG_5237_wheelEventOnHeader(); #endif void taskQTBUG_8585_crashForNoGoodReason(); @@ -190,7 +190,7 @@ private slots: void taskQTBUG_30653_doItemsLayout(); void taskQTBUG_50171_selectRowAfterSwapColumns(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void mouseWheel_data(); void mouseWheel(); #endif @@ -693,12 +693,14 @@ void tst_QTableView::keyboardNavigation() case Qt::Key_Backtab: if (!tabKeyNavigation) break; + Q_FALLTHROUGH(); case Qt::Key_Left: column = qMax(0, column - 1); break; case Qt::Key_Tab: if (!tabKeyNavigation) break; + Q_FALLTHROUGH(); case Qt::Key_Right: column = qMin(columnCount - 1, column + 1); break; @@ -3966,7 +3968,7 @@ void tst_QTableView::task248688_autoScrollNavigation() } } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QTableView::mouseWheel_data() { QTest::addColumn<int>("scrollMode"); @@ -4019,7 +4021,7 @@ void tst_QTableView::mouseWheel() QApplication::sendEvent(view.viewport(), &verticalEvent); QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 15); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void tst_QTableView::addColumnWhileEditing() { @@ -4283,7 +4285,7 @@ void tst_QTableView::changeHeaderData() QVERIFY(view.verticalHeader()->width() > textWidth); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader() { QTableView view; diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index f20805f97e..fa7f9596da 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -1560,10 +1560,9 @@ void tst_QTreeWidget::scrollToItem() { // Check if all parent nodes of the item found are expanded. // Reported in task #78761 - QTreeWidgetItem *bar; - QTreeWidgetItem *search; + QTreeWidgetItem *search = nullptr; for (int i=0; i<2; ++i) { - bar = new QTreeWidgetItem(testWidget); + QTreeWidgetItem *bar = new QTreeWidgetItem(testWidget); bar->setText(0, QString::number(i)); for (int j=0; j<2; ++j) { @@ -1571,9 +1570,8 @@ void tst_QTreeWidget::scrollToItem() foo->setText(0, bar->text(0) + QString::number(j)); for (int k=0; k<2; ++k) { - QTreeWidgetItem *yo = new QTreeWidgetItem(foo); - yo->setText(0, foo->text(0) + QString::number(k)); - search = yo; + search = new QTreeWidgetItem(foo); + search->setText(0, foo->text(0) + QString::number(k)); } } } @@ -1582,10 +1580,10 @@ void tst_QTreeWidget::scrollToItem() testWidget->scrollToItem(search); QCOMPARE(search->text(0), QLatin1String("111")); - bar = search->parent(); - QVERIFY(testWidget->isItemExpanded(bar)); - bar = bar->parent(); - QVERIFY(testWidget->isItemExpanded(bar)); + QTreeWidgetItem *par = search->parent(); + QVERIFY(testWidget->isItemExpanded(par)); + par = par->parent(); + QVERIFY(testWidget->isItemExpanded(par)); } // From task #85413 @@ -2663,7 +2661,7 @@ void tst_QTreeWidget::expandAndCallapse() { QTreeWidget tw; QTreeWidgetItem *top = new QTreeWidgetItem(&tw, QStringList() << "top"); - QTreeWidgetItem *p; + QTreeWidgetItem *p = nullptr; for (int i = 0; i < 10; ++i) { p = new QTreeWidgetItem(top, QStringList(QString::number(i))); for (int j = 0; j < 10; ++j) diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index b98cc048c8..6ff38abdb8 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -140,7 +140,7 @@ private slots: void execAfterExit(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelScrollLines(); #endif @@ -1773,7 +1773,7 @@ void tst_QApplication::execAfterExit() QCOMPARE(exitCode, 0); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QApplication::wheelScrollLines() { int argc = 1; @@ -1781,7 +1781,7 @@ void tst_QApplication::wheelScrollLines() // If wheelScrollLines returns 0, the mose wheel will be disabled. QVERIFY(app.wheelScrollLines() > 0); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void tst_QApplication::style() { diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 01c8e783ad..ab45a342e3 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -47,6 +47,7 @@ osx osx [showMinimizedKeepsFocus] osx-10.10 +osx-10.11 ci [moveWindowInShowEvent:1] osx [moveWindowInShowEvent:2] diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp index 937be944a1..f8095badb8 100644 --- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp +++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp @@ -348,7 +348,7 @@ void tst_QCompleter::getSetCheck() completer.setWrapAround(false); QCOMPARE(completer.wrapAround(), false); -#ifndef QT_NO_FILESYSTEMMODEL +#if QT_CONFIG(filesystemmodel) // QTBUG-54642, changing from QFileSystemModel to another model should restore role. completer.setCompletionRole(Qt::EditRole); QCOMPARE(completer.completionRole(), static_cast<int>(Qt::EditRole)); // default value @@ -361,7 +361,7 @@ void tst_QCompleter::getSetCheck() QStandardItemModel standardItemModel2(2, 2); // Do not clobber a custom role when changing models completer.setModel(&standardItemModel2); QCOMPARE(completer.completionRole(), static_cast<int>(Qt::ToolTipRole)); -#endif // QT_NO_FILESYSTEMMODEL +#endif // QT_CONFIG(filesystemmodel) } void tst_QCompleter::csMatchingOnCsSortedModel_data() diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index 17a5320433..f0d74e7797 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -74,7 +74,7 @@ private slots: void minimum_maximum(); void keyPressed_data(); void keyPressed(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent_data(); void wheelEvent(); void fineGrainedWheelEvent_data(); @@ -690,7 +690,7 @@ void tst_QAbstractSlider::keyPressed() QCOMPARE(slider->sliderPosition(), expectedSliderPositionVerticalInverted); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QAbstractSlider::wheelEvent_data() { QTest::addColumn<int>("initialSliderPosition"); @@ -941,7 +941,7 @@ void tst_QAbstractSlider::fineGrainedWheelEvent() QCOMPARE(slider->sliderPosition(), 1); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void tst_QAbstractSlider::sliderPressedReleased_data() { diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 75b75ad44c..2f4e1a32f3 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -120,11 +120,11 @@ private slots: void flaggedItems_data(); void flaggedItems(); void pixmapIcon(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void mouseWheel_data(); void mouseWheel(); void popupWheelHandling(); -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void layoutDirection(); void itemListPosition(); void separatorItem_data(); @@ -2037,7 +2037,7 @@ void tst_QComboBox::pixmapIcon() QCOMPARE( box.itemIcon(1).isNull(), false ); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) // defined to be 120 by the wheel mouse vendors according to the docs #define WHEEL_DELTA 120 @@ -2134,7 +2134,7 @@ void tst_QComboBox::popupWheelHandling() QVERIFY(comboBox->view()->isVisible()); QCOMPARE(comboBox->view()->pos(), popupPos); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void tst_QComboBox::layoutDirection() { diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index 9ab755c5f1..94e4fc005c 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -205,7 +205,7 @@ private slots: void reverseTest(); void ddMMMMyyyy(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(); #endif @@ -2998,7 +2998,7 @@ void tst_QDateTimeEdit::ddMMMMyyyy() QCOMPARE(testWidget->lineEdit()->text(), "01." + QDate::longMonthName(1) + ".200"); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void tst_QDateTimeEdit::wheelEvent() { testWidget->setDisplayFormat("dddd/MM"); @@ -3011,7 +3011,7 @@ void tst_QDateTimeEdit::wheelEvent() qApp->sendEvent(testWidget, &w); QCOMPARE(testWidget->date(), QDate(2000, 3, 22)); } -#endif // !QT_NO_WHEELEVENT +#endif // QT_CONFIG(wheelevent) void tst_QDateTimeEdit::specialValueCornerCase() { diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index de49d5ff45..ea468b378e 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -1,2 +1,4 @@ [task258920_mouseBorder] osx +[submenuTearOffDontClose] +osx-10.11 ci diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST index fa326a6ea5..7825c33a0a 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST +++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST @@ -1,5 +1,6 @@ [clearAndGrab] opensuse-13.1 +ubuntu #QTBUG-31611 [painter] diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 009a607818..e10c7591d5 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -55,6 +55,7 @@ private slots: void painter(); void reparentToAlreadyCreated(); void reparentToNotYetCreated(); + void reparentHidden(); void asViewport(); void requestUpdate(); void fboRedirect(); @@ -283,6 +284,36 @@ void tst_QOpenGLWidget::reparentToNotYetCreated() QVERIFY(image.pixel(20, 10) == qRgb(0, 0, 255)); } +void tst_QOpenGLWidget::reparentHidden() +{ + // Tests QTBUG-60896 + QWidget topLevel1; + + QWidget *container = new QWidget(&topLevel1); + PainterWidget *glw = new PainterWidget(container); + topLevel1.resize(640, 480); + glw->resize(320, 200); + topLevel1.show(); + + glw->hide(); // Explicitly hidden + + QTest::qWaitForWindowExposed(&topLevel1); + + QWidget topLevel2; + topLevel2.resize(640, 480); + topLevel2.show(); + QTest::qWaitForWindowExposed(&topLevel2); + + QOpenGLContext *originalContext = glw->context(); + QVERIFY(originalContext); + + container->setParent(&topLevel2); + glw->show(); // Should get a new context now + + QOpenGLContext *newContext = glw->context(); + QVERIFY(originalContext != newContext); +} + class CountingGraphicsView : public QGraphicsView { public: diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 08ef96bf1b..5238eea592 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -50,7 +50,7 @@ class tst_QScrollBar : public QObject private slots: void scrollSingleStep(); void task_209492(); -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void QTBUG_27308(); #endif void QTBUG_42871(); @@ -143,7 +143,7 @@ void tst_QScrollBar::task_209492() QCOMPARE(spy.count(), 1); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) #define WHEEL_DELTA 120 // copied from tst_QAbstractSlider / tst_QComboBox void tst_QScrollBar::QTBUG_27308() { diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 808c7f9d3d..07a2fd859d 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -69,7 +69,7 @@ public: { return QSpinBox::valueFromText(text); } -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(QWheelEvent *event) { QSpinBox::wheelEvent(event); @@ -1218,7 +1218,7 @@ void tst_QSpinBox::setGroupSeparatorShown() void tst_QSpinBox::wheelEvents() { -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) SpinBox spinBox; spinBox.setRange(-20, 20); spinBox.setValue(0); diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index bc94e2a05b..55ef44f4e0 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -199,7 +199,7 @@ private slots: void findWithRegExpReturnsFalseIfNoMoreResults(); #endif -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) void wheelEvent(); #endif @@ -2566,7 +2566,7 @@ void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults() } #endif -#ifndef QT_NO_WHEELEVENT +#if QT_CONFIG(wheelevent) class TextEdit : public QTextEdit { diff --git a/tests/baselineserver/shared/lookup3.cpp b/tests/baselineserver/shared/lookup3.cpp index 03e5f96e22..3d8d763bb7 100644 --- a/tests/baselineserver/shared/lookup3.cpp +++ b/tests/baselineserver/shared/lookup3.cpp @@ -207,9 +207,12 @@ quint32 initval) /* the previous hash, or an arbitrary value */ switch(length) /* all the case statements fall through */ { case 3 : c+=k[2]; + Q_FALLTHROUGH(); case 2 : b+=k[1]; + Q_FALLTHROUGH(); case 1 : a+=k[0]; - final(a,b,c); + final(a,b,c); + Q_FALLTHROUGH(); case 0: /* case 0: nothing left to add */ break; } @@ -253,9 +256,12 @@ quint32 *pb) /* IN: more seed OUT: secondary hash value */ switch(length) /* all the case statements fall through */ { case 3 : c+=k[2]; + Q_FALLTHROUGH(); case 2 : b+=k[1]; + Q_FALLTHROUGH(); case 1 : a+=k[0]; final(a,b,c); + Q_FALLTHROUGH(); case 0: /* case 0: nothing left to add */ break; } @@ -349,16 +355,24 @@ quint32 hashlittle( const void *key, size_t length, quint32 initval) switch(length) { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=((quint32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ + case 11: c+=((quint32)k8[10])<<16; + Q_FALLTHROUGH(); + case 10: c+=((quint32)k8[9])<<8; + Q_FALLTHROUGH(); + case 9 : c+=k8[8]; + Q_FALLTHROUGH(); case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=((quint32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ + case 7 : b+=((quint32)k8[6])<<16; + Q_FALLTHROUGH(); + case 6 : b+=((quint32)k8[5])<<8; + Q_FALLTHROUGH(); + case 5 : b+=k8[4]; + Q_FALLTHROUGH(); case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=((quint32)k8[1])<<8; /* fall through */ + case 3 : a+=((quint32)k8[2])<<16; + Q_FALLTHROUGH(); + case 2 : a+=((quint32)k8[1])<<8; + Q_FALLTHROUGH(); case 1 : a+=k8[0]; break; case 0 : return c; } @@ -388,23 +402,28 @@ quint32 hashlittle( const void *key, size_t length, quint32 initval) b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 11: c+=((quint32)k8[10])<<16; + Q_FALLTHROUGH(); case 10: c+=k[4]; b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 9 : c+=k8[8]; /* fall through */ + case 9 : c+=k8[8]; + Q_FALLTHROUGH(); case 8 : b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 7 : b+=((quint32)k8[6])<<16; + Q_FALLTHROUGH(); case 6 : b+=k[2]; a+=k[0]+(((quint32)k[1])<<16); break; - case 5 : b+=k8[4]; /* fall through */ + case 5 : b+=k8[4]; + Q_FALLTHROUGH(); case 4 : a+=k[0]+(((quint32)k[1])<<16); break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 3 : a+=((quint32)k8[2])<<16; + Q_FALLTHROUGH(); case 2 : a+=k[0]; break; case 1 : a+=k8[0]; @@ -439,16 +458,27 @@ quint32 hashlittle( const void *key, size_t length, quint32 initval) switch(length) /* all the case statements fall through */ { case 12: c+=((quint32)k[11])<<24; + Q_FALLTHROUGH(); case 11: c+=((quint32)k[10])<<16; + Q_FALLTHROUGH(); case 10: c+=((quint32)k[9])<<8; + Q_FALLTHROUGH(); case 9 : c+=k[8]; + Q_FALLTHROUGH(); case 8 : b+=((quint32)k[7])<<24; + Q_FALLTHROUGH(); case 7 : b+=((quint32)k[6])<<16; + Q_FALLTHROUGH(); case 6 : b+=((quint32)k[5])<<8; + Q_FALLTHROUGH(); case 5 : b+=k[4]; + Q_FALLTHROUGH(); case 4 : a+=((quint32)k[3])<<24; + Q_FALLTHROUGH(); case 3 : a+=((quint32)k[2])<<16; + Q_FALLTHROUGH(); case 2 : a+=((quint32)k[1])<<8; + Q_FALLTHROUGH(); case 1 : a+=k[0]; break; case 0 : return c; @@ -533,16 +563,24 @@ void hashlittle2( switch(length) { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ - case 10: c+=((quint32)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ + case 11: c+=((quint32)k8[10])<<16; + Q_FALLTHROUGH(); + case 10: c+=((quint32)k8[9])<<8; + Q_FALLTHROUGH(); + case 9 : c+=k8[8]; + Q_FALLTHROUGH(); case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ - case 6 : b+=((quint32)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ + case 7 : b+=((quint32)k8[6])<<16; + Q_FALLTHROUGH(); + case 6 : b+=((quint32)k8[5])<<8; + Q_FALLTHROUGH(); + case 5 : b+=k8[4]; + Q_FALLTHROUGH(); case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ - case 2 : a+=((quint32)k8[1])<<8; /* fall through */ + case 3 : a+=((quint32)k8[2])<<16; + Q_FALLTHROUGH(); + case 2 : a+=((quint32)k8[1])<<8; + Q_FALLTHROUGH(); case 1 : a+=k8[0]; break; case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ } @@ -572,23 +610,28 @@ void hashlittle2( b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 11: c+=((quint32)k8[10])<<16; /* fall through */ + case 11: c+=((quint32)k8[10])<<16; + Q_FALLTHROUGH(); case 10: c+=k[4]; b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 9 : c+=k8[8]; /* fall through */ + case 9 : c+=k8[8]; + Q_FALLTHROUGH(); case 8 : b+=k[2]+(((quint32)k[3])<<16); a+=k[0]+(((quint32)k[1])<<16); break; - case 7 : b+=((quint32)k8[6])<<16; /* fall through */ + case 7 : b+=((quint32)k8[6])<<16; + Q_FALLTHROUGH(); case 6 : b+=k[2]; a+=k[0]+(((quint32)k[1])<<16); break; - case 5 : b+=k8[4]; /* fall through */ + case 5 : b+=k8[4]; + Q_FALLTHROUGH(); case 4 : a+=k[0]+(((quint32)k[1])<<16); break; - case 3 : a+=((quint32)k8[2])<<16; /* fall through */ + case 3 : a+=((quint32)k8[2])<<16; + Q_FALLTHROUGH(); case 2 : a+=k[0]; break; case 1 : a+=k8[0]; @@ -623,16 +666,27 @@ void hashlittle2( switch(length) /* all the case statements fall through */ { case 12: c+=((quint32)k[11])<<24; + Q_FALLTHROUGH(); case 11: c+=((quint32)k[10])<<16; + Q_FALLTHROUGH(); case 10: c+=((quint32)k[9])<<8; + Q_FALLTHROUGH(); case 9 : c+=k[8]; + Q_FALLTHROUGH(); case 8 : b+=((quint32)k[7])<<24; + Q_FALLTHROUGH(); case 7 : b+=((quint32)k[6])<<16; + Q_FALLTHROUGH(); case 6 : b+=((quint32)k[5])<<8; + Q_FALLTHROUGH(); case 5 : b+=k[4]; + Q_FALLTHROUGH(); case 4 : a+=((quint32)k[3])<<24; + Q_FALLTHROUGH(); case 3 : a+=((quint32)k[2])<<16; + Q_FALLTHROUGH(); case 2 : a+=((quint32)k[1])<<8; + Q_FALLTHROUGH(); case 1 : a+=k[0]; break; case 0 : *pc=c; *pb=b; return; /* zero length strings require no mixing */ @@ -709,16 +763,24 @@ quint32 hashbig( const void *key, size_t length, quint32 initval) switch(length) /* all the case statements fall through */ { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((quint32)k8[10])<<8; /* fall through */ - case 10: c+=((quint32)k8[9])<<16; /* fall through */ - case 9 : c+=((quint32)k8[8])<<24; /* fall through */ + case 11: c+=((quint32)k8[10])<<8; + Q_FALLTHROUGH(); + case 10: c+=((quint32)k8[9])<<16; + Q_FALLTHROUGH(); + case 9 : c+=((quint32)k8[8])<<24; + Q_FALLTHROUGH(); case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((quint32)k8[6])<<8; /* fall through */ - case 6 : b+=((quint32)k8[5])<<16; /* fall through */ - case 5 : b+=((quint32)k8[4])<<24; /* fall through */ + case 7 : b+=((quint32)k8[6])<<8; + Q_FALLTHROUGH(); + case 6 : b+=((quint32)k8[5])<<16; + Q_FALLTHROUGH(); + case 5 : b+=((quint32)k8[4])<<24; + Q_FALLTHROUGH(); case 4 : a+=k[0]; break; - case 3 : a+=((quint32)k8[2])<<8; /* fall through */ - case 2 : a+=((quint32)k8[1])<<16; /* fall through */ + case 3 : a+=((quint32)k8[2])<<8; + Q_FALLTHROUGH(); + case 2 : a+=((quint32)k8[1])<<16; + Q_FALLTHROUGH(); case 1 : a+=((quint32)k8[0])<<24; break; case 0 : return c; } @@ -752,16 +814,27 @@ quint32 hashbig( const void *key, size_t length, quint32 initval) switch(length) /* all the case statements fall through */ { case 12: c+=k[11]; + Q_FALLTHROUGH(); case 11: c+=((quint32)k[10])<<8; + Q_FALLTHROUGH(); case 10: c+=((quint32)k[9])<<16; + Q_FALLTHROUGH(); case 9 : c+=((quint32)k[8])<<24; + Q_FALLTHROUGH(); case 8 : b+=k[7]; + Q_FALLTHROUGH(); case 7 : b+=((quint32)k[6])<<8; + Q_FALLTHROUGH(); case 6 : b+=((quint32)k[5])<<16; + Q_FALLTHROUGH(); case 5 : b+=((quint32)k[4])<<24; + Q_FALLTHROUGH(); case 4 : a+=k[3]; + Q_FALLTHROUGH(); case 3 : a+=((quint32)k[2])<<8; + Q_FALLTHROUGH(); case 2 : a+=((quint32)k[1])<<16; + Q_FALLTHROUGH(); case 1 : a+=((quint32)k[0])<<24; break; case 0 : return c; diff --git a/tests/manual/qtabbar/main.cpp b/tests/manual/qtabbar/main.cpp index b1ef0df100..5a1a558c10 100644 --- a/tests/manual/qtabbar/main.cpp +++ b/tests/manual/qtabbar/main.cpp @@ -56,12 +56,28 @@ #include <QLayout> #include <QDesktopWidget> #include <QTabWidget> +#include <QProxyStyle> + +class MyProxyStyle : public QProxyStyle +{ +public: + int styleHint(StyleHint hint, const QStyleOption *option = 0, + const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const + { + if (hint == QStyle::SH_TabBar_Alignment) + return Qt::AlignLeft; +// return Qt::AlignRight; +// return Qt::AlignCenter; + return QProxyStyle::styleHint(hint, option, widget, returnData); + } +}; const int TabCount = 5; int main(int argc, char *argv[]) { QApplication app(argc, argv); + app.setStyle(new MyProxyStyle); QWidget widget; QStackedWidget stackedWidget; @@ -69,7 +85,7 @@ int main(int argc, char *argv[]) tabBar.setDocumentMode(true); tabBar.setTabsClosable(true); tabBar.setMovable(true); - tabBar.setExpanding(true); + tabBar.setExpanding(false); // top tabBar.setShape(QTabBar::RoundedNorth); |