summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Lower timeout on tst_QSemaphore::tryAcquireWithTimeoutAllan Sandfeld Jensen2016-12-142-6/+3
| | | | | | | | The test was so slow it was blacklisted on all platforms for timing out. This patch lowers the timeout to a 5th and tries removing the blacklist. Change-Id: Ib28b21de572517c548a14300f26815598efe91e2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-1374-518/+1308
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
| * Accept ZWNJ, ZWJ and PUA characters in input widgetsEskil Abrahamsen Blomfeldt2016-12-123-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. Note that there is a hack where we disregard any character produced using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to keep the hack in this patch to limit the change (though I have made an exception for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it will probably have to be reverted. [ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QDir::cd(): Handle UNC server paths correctlyFriedemann Kleint2016-12-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a bool *ok out parameter to qt_normalizePathSegments() and return false when ".." are left over for an absolute path, indicating an attempt to change above root. Factor out static helper qt_cleanPath() to be able to pass the return value to QDir::cd() and return on failure from there. Amends change 63f634322b2c0f795bd424be9e51953a10c701de, which did not handle UNC paths. Task-number: QTBUG-53712 Change-Id: I3e63a5dd0259306a0b99145348d815899582f78e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QDir::cleanPath(): Do not cd above root paths (UNC, WinRT)Friedemann Kleint2016-12-121-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QDir::cleanPath() on "//server/path/.." resulted in "/". Factor out a function to determine the root path part of an absolute path for later use, and handle some special cases: - Consider server name of "//server/path/.." as part of the prefix. - Check on the root path for WinRT. Task-number: QTBUG-53712 Change-Id: Ibddacf06212b6fc86fa74a5e4078df6cfd5b66f5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Disable core dumps for selftests that are meant to be crashingTor Arne Vestbø2016-12-081-1/+3
| | | | | | | | | | | | Task-number: QTBUG-55155 Change-Id: I26a1461f35f916f3980fcb18cdddf3502e22fc90 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * UIKit: Improve handling of private system fonts / fallback fontsTor Arne Vestbø2016-12-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2bc7a40048 taught the CoreText font database to populate the families lazily, and in the process added a guard to ensure that we didn't populate internal fonts (prefixed with a '.'), as these fonts would then show up in font selection dialogs. Commit 909d3f5c7 then added support for private fonts, by making it possible to filter out any private fonts from font selection daialogs. But the guard was not removed, so we were still not populating these fonts. This guard has been removed, and the filtering function has been updated to include the conditions of the guard. Next, commit e5e93345c5 used [UIFont fontNamesForFamilyName:] to verify that each family that we registered with the font database would also have matching fonts when finally populated. This is not the right approach, as [UIFont fontNamesForFamilyName:] does not handle internal fonts. Instead we trust what CTFontDescriptorCreateMatchingFontDescriptors() gives us, but make sure to register the resulting font descriptors with the original/originating font family, instead of the one we pull out of the font descriptor. Finally, as of iOS 10, we can use CTFontManagerCopyAvailableFontFamilyNames instead of [UIFont familyNames], which gives us all of the internal font families like on macOS, instead of just the user-visible families. For earlier iOS versions we manually add '.PhoneFallback', as we know it will be available even if not listed in [UIFont familyNames]. The end result is that we register and populate families like '.PhoneFallback', which is critical to supporting more esoteric writing systems. The check in tst_QFont that styles for a given family is not empty has been removed, as we can't guarantee that on all platforms, which is also documented for QFontDatabase::styles(). Task-number: QTBUG-45746 Task-number: QTBUG-50624 Change-Id: I04674dcb2bb36b4cdf5646d540c35727ff3daaad Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * Fix qdrawhelper function toRGB64Allan Sandfeld Jensen2016-12-081-0/+16
| | | | | | | | | | | | | | | | | | The function was incorrectly handling green and blue color channels causing them to be dropped. This affects drawing non 32-bit images onto 10-bit per color channels formats such as RGB30. Change-Id: I9211e253b1a9da0dada5c418d592a8f531265989 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * tst_qsqlquery.cpp: Refactor runIntegralTypesMysqlTest()Friedemann Kleint2016-12-051-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 3370ab9119df09ca14f7d4641c555e60c1b3f478 introduced warnings from MSVC: tst_qsqlquery.cpp(4005): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation tst_qsqlquery.cpp(4059): note: see reference to function template instantiation 'void runIntegralTypesMysqlTest<bool>(QSqlDatabase &,const QString &,const QString &,const bool,const T,const T)' being compiled with [ T=bool ] tst_qsqlquery.cpp(4006): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation tst_qsqlquery.cpp(4006): warning C4804: '/': unsafe use of type 'bool' in operation tst_qsqlquery.cpp(4026): warning C4804: '+=': unsafe use of type 'bool' in operation Extract an overload taking a QVector of values and use that for the bool case instead of looping over min/max to generate a sequence of values for bool. Change-Id: I72583774e788b8df899f22ed1a64278217e664f6 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * Fix blending of RGB32 on RGB32 with partial opacityAllan Sandfeld Jensen2016-12-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | The alpha channel of an RGB32 image was not properly ignored when doing blending with partial opacity. Now the alpha value is properly ignored, which is both more correct and faster. This also makes SSE2 and AVX2 implementations match NEON which was already doing the right thing (though had dead code for doing it wrong). Change-Id: I4613b8d70ed8c2e36ced10baaa7a4a55bd36a940 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
| * Fix tst_QComboBox::getSetCheck()Friedemann Kleint2016-12-011-2/+2
| | | | | | | | | | | | | | | | Change 2fd3d8ea9e3e1829653942431070a83569bab6eb broke the QCOMPARE() in there, partially revert. Change-Id: I8f572b9d82ad1c6b5448504eda7cc2fa53fa3d3d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * Add a test case for removing a submenu from the menubarDmitry Shachnev2016-12-011-0/+18
| | | | | | | | | | | | | | | | | | If 5ca9631d3a0717afb066471ed5eb3b3ed9a9c08a is reverted, this test segfaults on Unity most of the times. Task-number: QTBUG-55966 Change-Id: Ice59842e0a1a7930e3cd10c4c7319ef033fe6a58 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * tst_QTextStream: Use casts instead of Q_UINT64_C for negative values cast to ↵Friedemann Kleint2016-11-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | quint64 Q_UINT64_C appends a literal, which causes warnings: tst_qtextstream.cpp(2026): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2030): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2031): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2032): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2289): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2309): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2329): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2355): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2381): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2411): warning C4146: unary minus operator applied to unsigned type, result still unsigned Change-Id: I69ac87c224b75aff059477362d8a317c7e766ec2 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * tests/auto/widgets: use QCOMPARE(., nullptr)Marc Mutz2016-11-3030-240/+240
| | | | | | | | | | | | | | | | | | | | | | | | .. instead of manually casted 0s. QCOMPARE(., nullptr) was added for Qt 5.8. Make use of the new API. In tst_qwidget.cpp, as a drive-by, change qApp->focusWidget() -> QApplication::focusWidget() Change-Id: I1331b8916b026d48e01534d1ed0b3d72f3f3d50c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix warnings in tests (MinGW/MSCV)Friedemann Kleint2016-11-294-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | tst_qtcpsocket.cpp:606:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tst_qtcpsocket.cpp:670:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tst_qfile.cpp(2661): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) tst_qarraydata.cpp(760): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) main.cpp:40:33: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result] Change-Id: I80ccef29b71af6a2c3d45a79aedaeb37f49bba72 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * tst_qchar: Silence deprecation warningFriedemann Kleint2016-11-291-0/+5
| | | | | | | | | | Change-Id: I248d815862a4172ceae6ba45391cba0a30b8e1ae Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix bilinear sampling of more than 8x rotated transformsAllan Sandfeld Jensen2016-11-292-2/+11
| | | | | | | | | | | | | | | | The check for 8x zoom was inverted and checked for 1/8x zoom. Change-Id: I45156db709bab6b702769c2a70d4d2af51b5533a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Fix tst_QString::sprintf()Friedemann Kleint2016-11-291-6/+11
| | | | | | | | | | | | | | | | Compare to QLatin1String and use reinterpret_cast to fix MSVC warning: tst_qstring.cpp(1271): warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size Change-Id: I4f26d72f0fad59e09636fe609a2772309a688e5c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Fix some warnings in testsFriedemann Kleint2016-11-286-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../tst_qfile.cpp: In member function 'void tst_QFile::handle()': ../tst_qfile.cpp:2661:38: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result] tst_qstatictext.cpp:862:58: warning: unused parameter 'textItem' [-Wunused-parameter] ../tst_qtcpsocket.cpp: In member function 'void tst_QTcpSocket::abortiveClose()': ../tst_qtcpsocket.cpp:2254:90: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Test.cpp: In member function 'void My4Socket::read()': Test.cpp:66:20: warning: 'reply' may be used uninitialized in this function [-Wmaybe-uninitialized] ../tst_qlocalsocket.cpp: In lambda function: ../tst_qlocalsocket.cpp:701:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../tst_qtcpserver.cpp: In member function 'void tst_QTcpServer::linkLocal()': ../tst_qtcpserver.cpp:935:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] ../tst_qtcpserver.cpp:940:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Change-Id: Ic315069768bcb63a6b333c28ac65b0b992b0d43f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * tests/manual,auto/qstorageinfo: Use function pointer in print helperFriedemann Kleint2016-11-251-5/+5
| | | | | | | | | | | | | | | | | | Fix warning about unused variable printer in auto-test and redirects output to qInfo() as intended. Amends change a26435d65ceac5d714d5cc7d5af2326e162d7a41. Change-Id: Ia72a93267a54b9c4f9ef37fa058b95ef586ecc75 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * tst_qsql.cpp: Remove deprecated module includeFriedemann Kleint2016-11-251-1/+0
| | | | | | | | | | | | | | | | Fix warning: include/QtSql/qsql.h:4:4: warning: #warning Header <QtSql/qsql.h> is deprecated. Please include <QtSql/qtsqlglobal.h> instead. [-Wcpp] Change-Id: I254c6ac9ddb0f49a7f4dc8b3de44fd1010f6243e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-249-34/+109
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_winrt.cpp tools/configure/configureapp.cpp tools/configure/environment.cpp Change-Id: Ieae6f2ee004a87f041751852b687484f91ee4480
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-239-34/+109
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 0d2f0164f45cb626c40a7c95026ba00fa56ac249. Conflicts: header.BSD-NEW qmake/Makefile.win32 src/openglextensions/qopenglextensions.cpp src/openglextensions/qopenglextensions.h src/winmain/qtmain_win.cpp src/winmain/qtmain_winrt.cpp tools/configure/configureapp.cpp util/glgen/qopenglextensions.cpp.header util/glgen/qopenglextensions.h.header Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
| | | * Handle RemovePath correctly when calling matches()Andy Shaw2016-11-221-0/+50
| | | | | | | | | | | | | | | | | | | | Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b Reviewed-by: David Faure <david.faure@kdab.com>
| | | * tst_QFormLayout: Fix UB (invalid enum value) in several functionsMarc Mutz2016-11-221-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code coerced a -123 into a QFormLayout::ItemFlags, which, however, being an enum with enumeration values 0..2, only has valid numerical values 0..3. Fix by using 3 as the value to represent the invalid enum value, and store this in a constant so as not to distribute this magic number all around the test class. Change-Id: Ie5e93a69ef5a3acdde43030b022e0cce8aec484d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * tst_qstandardpaths: Disable WOW64 redirection on WindowsFriedemann Kleint2016-11-221-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise not found. Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3 Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | | * tst_QDateTimeEdit: Use base method, not direct member accessEdward Welbourne2016-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A test was directly accessing the .text member of QDateTimeParser (which presently has nothing private). Use the virtual .displayText() method of this base instead, to let the base have some hope of data-hiding (maybe, some day). Change-Id: I8b6e39fba130de56f117bffb2aec346197969c5b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Speculative fix for tst_QThread::wait2() flakinessAllan Sandfeld Jensen2016-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test fails on Windows occasionally with values just short of 800, the lowest observed being 791. It is probably rounding somehow to 10ms segments, so allow it to be up to 10 ms too fast. Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | | * Use QPersistentModelIndex for storing a model indexAndy Shaw2016-11-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QModelIndex is not safe to be used to store an index as it is designed to be discarded right after use as the index information can change. Therefore a QPersistentModelIndex should be used instead to store the index. Subsequently the m_index does not need to be updated whenever the model changes anymore as this is already done for us. Task-number: QTBUG-49907 Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | | * Fix warnings in tst_q{table,list}widgetMarc Mutz2016-11-162-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC warned: tst_qtablewidget.cpp:30: tst_qtablewidget.cpp: In member function ‘void tst_QTableWidget::mimeData()’: qtestcase.h:66:52: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if (!QTest::qVerify(static_cast<bool>(statement), #statement, "", __FILE__, __LINE__))\ ^ tst_qtablewidget.cpp:1523:5: note: in expansion of macro ‘QVERIFY’ QVERIFY(data = table.mimeData(tableWidgetItemList)); ^~~~~~~ Fix by adding the extra parentheses, as usual. Change-Id: I2826d7a865b4113b468d5a958ede06e03aa0e278 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Stabilize tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()Friedemann Kleint2016-11-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test relied on the file created being automatically selected, which sometimes does not happen when executing the entire test. Explicitly select the file and check the selection. Use the temporary directory for testing. Change-Id: Ia58641c1ac32ba21effa8a5ace9623eb5d48a1c2 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * | | Register fonts with preferred names on WindowsAllan Sandfeld Jensen2016-11-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks up the canonical names of enumerated fonts and register them under their preferred names if present. Also changes the logic handling registration of english aliases, so it is always done, even if it might in rare cases cause a double registration since that is safe. Task-number: QTBUG-53458 Change-Id: Ia010774b26072192b55697b717cc37442c852881 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | | AreArgumentsNarrowedBase: Correct logic for narrowing connect() castsEdward Welbourne2016-11-231-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prior test deemed there to be narrowing if source and destination integral-or-enum types didn't have the same signedness; but all values of an unsigned source type can be represented in a larger signed destination type, so there is no narrowing in this case. Updated QObject test-case to match. Change-Id: I517a5997adcad70e185d7469a8d26788e463cb75 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | | QMutex: make sure we try_lock_for no shorter than the duration passedMarc Mutz2016-11-221-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By templating on the <chrono> types and unconditionally using duration_cast to coerce the duration into a milliseconds, we allowed code such as mutex.try_lock_for(10us) to compile, which is misleading, since it's actually a zero- timeout try_lock(). Feedback from the std-discussions mailing list is that the wait_for functions should wait for _at least_ the duration given, because that is the natural direction of variance (tasks becoming ready to run might not get a CPU immediately, causing delays), while an interface that documents to wait _no more_ than the given duration is promising something it cannot fulfill. Fix by converting the given duration to the smallest number of milliseconds not less than the original duration. If that is not representable in an int, use INT_MAX, emulating the effect of a spurious wakeup, which are allowed to happen if the function returns false in that case. In the above example, the try_lock_for call is now equivalent to mutex.tryLock(1); The tryLock() docs state that the actual waiting time does not exceed the given milliseconds, but fixing that is a separate issue. Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Fix SCTP API according to Qt conventionsFriedemann Kleint2016-11-221-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inDatagramMode() -> isInDatagramMode() maxChannelCount -> maximumChannelCount Change-Id: Ib64bf52cc3b40354927ee11e3f41d47e84c6d9c4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | | Fix missing last modification time stamp in qrc contentSimon Hausmann2016-11-223-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The time stamp is added at the end of the node information and consequently this also bumps the version. Task-number: QTBUG-57182 Change-Id: Ia10e006f28c0b168b2bcd74ed8b7098f84d10af3 Reviewed-by: hjk <hjk@qt.io>
| * | | Extend manual test windowflagsFriedemann Kleint2016-11-185-152/+434
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the main window to contain a QTabWidget and add a log widget logging relevant events on the top level widgets for testing changes. In the preview window, add new window flags of Qt 5 and output geometry, margins and window state in addition. Change-Id: Icec366223b6c163d58a69034687f3d9323a91533 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | | tst_qhooks: test that it's possible to chain multiple hooks togetherMitch Curtis2016-11-181-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chaining hooks together was mentioned by Ossi in the comments of d953d9a4. This patch justs add a test that verifies that it works, and also serves as an informal example for developers looking how to do it. Change-Id: I53a014d5663c289ea0559e0926ed301f4e5110e6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* | | | tst_QTimeZone::printTimeZone: pass zone by referenceEdward Welbourne2016-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a const parameter, so no sense copying it. Change-Id: I4a673a6a60af9bfe7cb61ce28de2aa295fa1d069 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | tst_QTimeZone: tidy up handling of debug memberEdward Welbourne2016-12-121-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it const, initialize it instead of assigning, consolidate testing of it round some #if-ery. Change-Id: I2efbf58292a0edd2ceb3da8d3cc16246e84a3bac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QDateTime, QTimeZone: fix mappings from zone time to UTCEdward Welbourne2016-12-122-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such mappings are ill-defined in the presence of daylight-savings time (DST); at its transitions, you need information about whether DST is active or not to determine the correct UTC value. Existing code did not have a way to be told that hint, so could not be correct. Fixing this required changing the (thankfully private) APIs by which QDateTime accessed QTimeZone's information stipulated by zone time. In QDateTime, this required propagating the needed hint, when DST status was known. QAndroidTimeZonePrivate overloaded QTimeZonePrivate::dataForLocalTime with an implementation that works whenever !hasTransitions(); the base implementation handled this case lamely, so I've moved the Android implementation there, to have only one place for both re-writes. Amended tst_QDateTime's expected failures; passing a date and time to the constructor *is* ambiguous when the moment indicated is in a transition. I have changed which way we resolve that ambiguity. Added round-trip test of QDateTime's fromMSecs/toMSecs (but as a QTimeZone test, since that's what's actually getting tested), based on a test-case from Marko Kangas. Initially failed for various zones, each at one hour-offset; and, on some platforms, for some zones, at all offsets. These last revealed that a platform may claim to have zone information yet, for some zones, lack it (or have very incomplete information). In each case, despite this, the platform does give offsetFromUtc(). (The test also found another pre-existing bug on Linux; fixed in an earlier commit.) To accommodate these gaps in transition data, the transition-based code now falls back to the offsetFromUtc()-based code (used when there are no transitions) if it can't find a previous transition (which, in any case, it needs to do its job). Task-number: QTBUG-56460 Task-number: QTBUG-56397 Task-number: QTBUG-52284 Change-Id: I2f7422a9e9d3767940b1901d887c6a2c1f36ac9f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | foreach: do not use operators that trigger non-evaluated contextsGiuseppe D'Angelo2016-12-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: decltype(). Ideally we'd want C++17's template constructor argument deduction, but instead use the C++11 solution: a factory function. This enables using things such as lambdas in the container argument. Change-Id: Idba64d8069d15bbafe54cfdebe24b1fba1eb8d0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Use RGB64 qdrawhelper routines for unpremultiplied formatsAllan Sandfeld Jensen2016-12-092-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ARGB32PM code-path doesn't have enough precision to accurately render ARGB32 images, but the RGB64 code-path does. Since this is already a slow configuration and the most costly part is the conversion we can switch to the more accurate code-path for little cost. Task-number: QTBUG-55720 Change-Id: Ifa0afba8d8cc0c2f699bb91f51726f4ee5228f3e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | | Cleanup memrotate functionsAllan Sandfeld Jensen2016-12-081-29/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Throw out unused code and simply format table to only care about bpp and use it consistently for all bpp. Also makes QImage use the 180 degree memrotate, and fixes the tiled packed qt_memrotate270 so it can be put to use. Change-Id: If4ef1666fca960ce8e4ce32d85dc5f347b6986f4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | | Introducing QSplitter::replaceWidget()Gabriel de Dietrich2016-12-021-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new API addresses the use case where we want to replace a widget by another one inside the splitter. Up to now, the way of doing would include removing one widget and add the new one at the same place. However, this triggers a series of resize and paint events because of the successive changes in the splitter's children leading to a relayout of the remaining children. The new widget inherits the same properties as in the previous slot: geometry, visibility, and collapsed states. The previous widget, returned by the function, loses its parent and is hidden. Change-Id: I3dddf6b582d5ce2db8cff3c40bc46084263123ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | | QMenuBar tests: Ignore shortcut related test on MacGabriel de Dietrich2016-11-302-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove references to WinCE in comments. Change-Id: I175e0ba5f9597b09532c507497a51a55f9e0b5c0 Task-number: QTBUG-56853 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | | Add configurable connect timeout for QAbstractSocketSamuel Gaist2016-11-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim of this patch is to allow the configuration of the connect timeout used by QAbstractSocket that is currently hardcoded to 30 seconds. Using QNetworkConfiguration for this allows to adapt the timeout per network configuration (e.g. 2G vs wired lan) [ChangeLog][QtNetwork] The connect timeout from QAbstractSocket is now configurable through QNetworkConfiguration. Change-Id: I1dc4051be2c74f925f7a9e0a9ccef332efc2e370 Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
* | | | Replace QDrawHelperGammaTables with QColorProfileAllan Sandfeld Jensen2016-11-241-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns the two set of tables in QDrawHelperGammaTables into two QColorProfile classes that use similar structures and can be reused for other gamma correction. At the same time clean-up and improve the comma-correct blending code to use the new profiles and QRgba64 precision. Change-Id: I302bd87a5c836e1010fff6d633eeb56fd4ae2ff0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Introduce QWindow::setFlag and QWidget::setWindowFlagDaniel Vrátil2016-11-222-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analogous to QWidget::setAttribute(), introduce an API to easily enable/disable a single window flag without having to resort to w.setFlags(w.flags() | Qt::NewFlag). Change-Id: Ib0f7254a34c8d884cdec181c41b99e5ef035d954 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-1757-191/+669
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/uikit/default_post.prf Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218