summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | | Remove last traces of opengl es 1 supportLars Knoll2016-11-161-4/+2
| | | | | | | | | | | | | | | Change-Id: I3f86d4892ec3235003d34fdcf3f093f1513c821f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Manual Dialog test: Fix compilation against Qt 4Friedemann Kleint2016-11-161-0/+3
| | | | | | | | | | | | | | | Change-Id: I79a90cd252e99fb94c0429a3f03eb1ddacab1786 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | QCocoaMenu: Force NSMenuValidation when syncing itemsGabriel de Dietrich2016-11-164-51/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a menu item's enabled state changes after -[QCocoaMenuDelegate menuWillOpen:] is invoked, i.e., during or after QMenu::aboutToShow() is emitted, that state change may not be taken into account. This is because the automatic menu validation, upon which Qt relies, is not made aware of any such change. By calling -[NSMenu update] when syncing the QPA menu item, we induce Cocoa to invoke -[QCocoaMenuDelegate validateMenuItem:] and ensure that previously synced items, whose state may have changed, will be properly updated. This, however, has a small side effect, namely that menu-holding items will also go through the automatic menu enabling path and may appear disabled since, until now, they were not properly configured. In order to solve this, we set the action on those items as well, and make sure that both of QCocoaMenuDelegate's relevant methods, validateMenuItem: and itemFired:, properly process menu-holding items. Menurama manual test updated accordingly. Change-Id: I62f955538b8be09b8494ea0ce87fca7910148d38 Task-number: QTBUG-56850 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-1642-25/+430
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-1542-25/+430
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b
| | * tst_QFileSystemModel::specialFiles(): Remove Windows partsFriedemann Kleint2016-11-141-15/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test created a Windows shortcut (.lnk) and checked on its existence. It was not found in the first test since QFileSystemModel returned the resolved file name (linktarget.txt). When fixing this by querying QFileSystemModel::fileInfo()::fileName(), the 2nd test failed since shortcut files are not considered system files. Amends change 3b093034b638a69b4dc91212d1743638864a1337. Task-number: QTBUG-53890 Task-number: QTBUG-20968 Task-number: QTBUG-29403 Change-Id: Iec58b52532b44d12759eaa6c8d63a8a4dc8d1bc3 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| | * fix $$section()'s bad argument count error messageOswald Buddenhagen2016-11-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | the autotest was also broken, because it was created by pasting the bogus message into the result ... Change-Id: I02b8663b96c7d96cdb3c19639e2213e49fd2bcec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| | * Fix writing into application directoryMaurice Kalinowski2016-11-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | Tests are not supposed to write into the build/application directory, but rather should output to the temp directory. Change-Id: Idcdf51226a2d547514aea2fbb2054998d8a3437e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * Improve the validation algorithm for binary JSONLars Knoll2016-11-1129-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Add better boundary checks and catch (hopefully all) cases where invalid binary JSON could cause crashes. Change-Id: I206510b7c5e3ba953802a5f46645878e65704ecc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Don't count no-break spaces as trailing spacesEskil Abrahamsen Blomfeldt2016-11-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No-break-spaces should not be counted in the space data, but rather be treated as any other non-breakable character. We were already taking care of this in the loop we reach if the item starts with a character which isn't whitespace, but there is a second loop for items that begin with whitespace characters. The result of this was that in certain circumstances where you gave the nbsp its own format and made the line wrap, the previous line would count an extra trailing space and it would swallow the first character in its following line. [ChangeLog][QtGui][Text] Fixed a bug where a no-break space would sometimes cause the first character of the containing line to not be displayed. Task-number: QTBUG-56714 Change-Id: Idd760a389052e6de70f6cc397122b217987fa5f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * QLabel: take DPR of QMovie in account when calculating sizeHintDaniel Vrátil2016-11-092-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLabel already does that for QPixmap, so just do the same for QMovie's current pixmap. Task-number: QTBUG-48157 Change-Id: I7b26460f778e56ff017a5efd433f8929f30e4b41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * Cocoa: Make child window cursors work correctlyMorten Johan Sørvig2016-11-087-1/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing cursor logic had a couple of issues: - It made the faulty assumption that we could not use the NSWindow invalidateCursorRectsForView API for child NSViews. - It used NSWindow invalidateCursorRectsForView and NSView resetCursorRects. This API has been replaced by the more general NSTrackingArea API. - It did not implement falling back to the parent window cursor if the current window has no cursor set. Document that QWindow cursors work the same way as QWidget cursors in that a QWindow with no set cursor will fall back to the parent window cursor. Change the cocoa platform code to use NSTrackingArea exclusively and implement NSView cursorUpdate which sets the cursor. Handle immediate change on QWindow:: setCursor() manually. Add QWindow::effectiveWindowCursor() and applyEffectiveWindowCursor() which finds the correct window cursor. Add a manual test for the child window, child widget, and QWidget::createWindowChild cases. Task-number: QTBUG-33479 Task-number: QTBUG-52023 Change-Id: I0370e11bbadb2da95e8632e61be6228ec2cd5e9d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | qmake: make discard_from() patch up QMAKE_INTERNAL_INCLUDED_FILES as wellOswald Buddenhagen2016-11-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | when the file's effects are discarded, the mention of the file should be as well. Change-Id: I894b7e2b887dd34d18533b197bfa9d0d84d647e7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | qmake: let discard_from() discard function definitions as wellOswald Buddenhagen2016-11-152-2/+12
| | | | | | | | | | | | | | | | | | | | | for completeness. Change-Id: I3ffc14e041408c773e277442828170e3df04ec8d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Improve QMake JSON errorAllan Sandfeld Jensen2016-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We can not improve the result from JSON parsing without changing API, so instead recalculate the line and column based on input and offset. Change-Id: I54149233f71023aa5d30deff854d6f3406c5c48c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Improve error offset in JSON parsingAllan Sandfeld Jensen2016-11-151-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not consume white-space after a token before the token has been parsed, otherwise we end up with misleading offsets. This also fixes a wrong error of illegal number in several cases. Change-Id: I492ca4de0346a1d0ab73b1c23d7a72dba812664c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Clean up some conditions in our pro filesLars Knoll2016-11-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change qtConfig(opengl(es2)?) to qtConfig(opengl) as that covers the case without any regular expression. Change-Id: I935e3150f87e195e8bd3d0e55b4ed43572b131cf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | QComboBox: Prioritize the model font for popup itemsGabriel de Dietrich2016-11-101-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Mac, we use QComboMenuDelegate specifically as item delegate for the popup list. It happens that the order of resolving the font for each item individually would prioritize QComboBox's font instead of whatever the assigned model's FontRole would specify. The fix only requires checking whether FontRole is valid before falling back QComboBox's properties. Change-Id: I7208ad1911b30cc52c826c1884a1e19f5acd9fb4 Task-number: QTBUG-56693 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | Rename QtPrivate::is_[un]signed to QtPrivate::Is[Un]signedEnumKai Koehne2016-11-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Any other use than for enums should use std::is_[un]signed. Make this explicit by renaming the type traits. Change-Id: I494158563c95c710e710d0d337f4e547006df171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove compiler-specific implementations of Q_IS_ENUMKai Koehne2016-11-092-96/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the macro is now just a wrapper for std::is_enum, its use is also deprecated. [ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated. Use std::is_enum<>::value instead. Change-Id: I09b9f4559c02c81f338cace927873318f2acafde Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Replace custom type traits with std one'sKai Koehne2016-11-082-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QVariant to QJsonValue::Null conversionAllan Sandfeld Jensen2016-11-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a few missing parts of the conversion from QVariant to QJsonValue after the introduction of the nullptr QVariant. The conversion the other way is already implemented. Change-Id: I8b25dec4b476c4761c5098a60944ff11c36f8bec Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Windows: Don't claim bitmap fonts support all standard sizesEskil Abrahamsen Blomfeldt2016-11-071-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were throwing away important information by claiming that all fonts support all the standard sizes in QFontDatabase on Windows This caused the font dialog to list unsupported sizes for bitmap fonts, unlike the native font dialog. We would also claim to support creating bitmap fonts at unsupported sizes, which would lead to 1. QFontInfo(font).pointSize() would return the requested size, not the actual rendered size. 2. Bitmap fonts created at 64 pixels and higher would be invisible. On Mac, there are no system bitmap fonts, and the use is not very common, but installing some bitmap fonts on the system, it does seem to ignore the sizes supported in the font and just displays the standard list instead, so we keep the current behavior there. [ChangeLog][QtGui][Text] Fixed list of supported sizes for bitmap fonts on Windows. Task-number: QTBUG-56672 Change-Id: Idbec2db9eb3381ab5ddf6259bd2befcba9b93564 Reviewed-by: Lars Knoll <lars.knoll@qt.io>