summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix QListView assert when the last row is moved in IconModev6.2.0-beta4ChunLin Wang2021-09-012-2/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | After the last row is moved, 0 will be returned when obtaining row and column data. At this time, QListView::doitemslayout will not call d->doitemslayout, so the QBspTree data structure will not be cleaned up, leaving a stale tree structure behind. This will trigger an assert during paintEvent handling if QListView is set to IconMode In QListView::ListMode the test for a valid model index doesn't use an assert. Call QListViewPrivate::clear explicitly if the column count is 0 so that the QBspTree and other data structures are cleared. Add a test case that simulates this scenario by implementing a model that returns a 0 column count for an index after the model structure was changed through a move of rows. Done-with: Volker Hilsheimer Fixes: QTBUG-95463 Change-Id: I36419be5459b8ced930c619f538482ea1db4ad03 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ca69e5aeef2fef540e687475ac00a4f332fdc5f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qlocale_win: Fix non-standalone month namesEdward Welbourne2021-09-012-6/+40
| | | | | | | | | | | | | | | | | | | | | We have previously been using the standalong (nominative) month names both when asked for that and when asked for the plain (genitive) month name, probably because there was no LCTYPE value for the latter. However, MS's docs for the standalone values do contain a comment telling us how to get the genitive names. Rename the old monthName() to standaloneMonthName() and add a monthName() that calls GetDateFormat() suitably, as described by the MS doc. Fixes: QTBUG-92018 Fixes: QTBUG-86279 Change-Id: I27f63198c3a15b792683f476d2019078b0860f99 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 38ec2c830b849ad44ca7e16bd9c4722e0bcdb61f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update bundled libjpeg-turbo to version 2.1.1Eirik Aavitsland2021-09-0112-24/+81
| | | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.1 Change-Id: I22a273018229aa35a175f9e903fa605a3eb55c32 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit a6a3b1e79cf9bd54434ccdb0851fe49f12004152) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* When clearing QPixmapCache, stop its flushing timerEirik Aavitsland2021-09-011-0/+5
| | | | | | | | | | | | | | | No need for timer event to reduce cache size when it is already empty. May also avoid the "Timers cannot be stopped from another thread" warning at exit, if the global cache object is then deleted by another thread. Fixes: QTBUG-96101 Change-Id: Id1aeecfbb43a25a887ebd5cc7242749a74290bb0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dc65267ad8c086950c23185c8cebc304a8d1c3dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QDoubleValidator: fix NaN check in validateWithLocaleIvan Solovev2021-09-012-2/+9
| | | | | | | | | We can't really compare two NaN's. Should use qIsNaN() for that. Change-Id: Ia514cabe65cfcdeafb39cab91ecdb66f8fae725c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 313de93b1d2f415a845521b64e58d81a6e9d7a13) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix documentation of QNetworkAccessBackendMårten Nordheim2021-09-011-0/+111
| | | | | | | | | | | | | | | | | | | | The classes themselves were not documented, so...: Add some documentation for QNetworkAccessBackendFactory. Add some overall class docs for QNetworkAccessBackend. The class docs were marked \internal (because they mostly are). I don't think we yet have a defined way to handle semi-private APIs but having them be marked \internal and leaving the documentation in source seems fine (and was what someone suggested a while back). Add documentation for pure virtual functions which were overlooked. Fixes: QTBUG-88774 Change-Id: Id7fe18ec92372abb96540cd29543608f87ec862e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 81a9335c653661f70d8bfa8f37d2d72bdef60d41) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix corner case in QTimeZonePrivate::dataForLocalTime()Edward Welbourne2021-09-011-14/+18
| | | | | | | | | | | | | | | | If the local time for which we want data is after the last known transition, the two transitions we get to bracket it are the last known and an invalid one. The code checked the former was valid, but neglected to check the latter, leading to nonsense arithmetic later in the function. In this situation we unequivocally want the last known transition, so the problem is easily solved. Fixes: QTBUG-96152 Change-Id: I6fc830ce538e8a572093cd8dfe832e10689bf904 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit b656cea5deccab352b7c4c56d7023f5108578654) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Refine QLocale constructor documentationEdward Welbourne2021-09-011-4/+4
| | | | | | | | | Fix a typo and swap two sentences to give a clearer reading. Change-Id: I4a24ad5ba2e022edd121eb686de3638af2c242a6 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit f98d9aa9da1f858cd499d7d6687fc137f40939f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Forward touchEvents to children inside QGraphicsProxyWidget"Volker Hilsheimer2021-09-013-14/+10
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1ecf2212fae176b78c9951a37df9e33eb24d4f2d. The fix is not correct after all. TouchBegin goes to the correct widget with the fix, but following TouchUpdate and TouchEnd events now go to the viewport, as QApplication::translateRawTouchEvent always gives precedence to the widget that Qt recorded to be the touch grabber, which is the viewport. This results in infinite recursion, as the proxy widget trying to send the touch events to the embedded widget (expecting that translateRawTouchEvent will split it up) ends up sending the events back to the viewport. Leave the added test case as QEXPECT_FAIL, reactivate the (never run, hence unnoticed) test that the fix broke. Task-number: QTBUG-45737 Task-number: QTBUG-67819 Change-Id: I4810affb3cd066743ae94ab7beb2f0c06b60d211 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6e2a5312db6ec933910407fe47c9d73d3170d0af) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: fail when configuring for wasm and EMSDK is not foundLorn Potter2021-09-011-1/+6
| | | | | | | Change-Id: Ic7fb933d8c2b42c3ba84a3b5a6c89a808d971bd1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 375c7c47ff29d40ace4b489738510fac96997c21) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFileDialogComboBox: member variable is not initializedYang Yuyin2021-08-312-11/+4
| | | | | | | | | | | initialize d_ptr in the constructor Change-Id: I5a8062dd0a81023e6c1a5858bb8603d279cdbcee Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 6e9cae0b77dbc9a59e500ea8ceb6b60b74b1988b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure versionless wrappers do not introduce a new variable scopeCraig Scott2021-08-314-69/+60
| | | | | | | | | | | | | | | Using function instead of macro prevented the wrappers from being able to pass back any variables set in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Change-Id: Ic4486de668694c06b47e466587b2cdcb969ea047 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 08180e76e6116f0ef66476ca00b2b676b3aa50da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmake: Add support for C17/C18Joerg Bornemann2021-08-314-1/+9
| | | | | | | | | | | | | Make it possible to select the C17/C18 standard with CONFIG += c17 or CONFIG += c18 Fixes: QTBUG-96026 Change-Id: I719d22366c3efda009118d58ead173a25ed285c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9004575f4b2aee7bf3c55522affd10555d134c51) Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Painting: handle large and negative dash offset valuesEirik Aavitsland2021-08-302-3/+6
| | | | | | | | | | The mapping of the dash offset into the dash pattern was susceptible to int overflow. Change-Id: I254ed40b323ef516d10abc8e6008b14cfc23d2a0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit ca604964f651b71f2b2a45a65e741167f520b714) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move QGraphicsProxyWidget test into correct test caseVolker Hilsheimer2021-08-302-310/+315
| | | | | | | | | | | | | | | | The test case was previously disabled, so tests were added to the QGraphicsView test instead. With the QGraphicsProxyWidget test active again, move the test cases where they belong. Amends 1ecf2212fae176b78c9951a37df9e33eb24d4f2d, 01aeb5f7e4fd977e9698fffdc7650897664ecb82, and 06235d36ae9d00366215e748d80ff0faed3c2124 Change-Id: I208b8a418653cf0640c2e7c9f716fa69538ad7e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 5c7c2f84bcc1d934315ed86757791b0810be9c1e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Reactivate QGraphics(Proxy)Widget unit testsVolker Hilsheimer2021-08-305-543/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | They were de-facto disabled in the qmake build system, and didn't make it into the cmake build system either. The dependency to the fusion style is not a build-time dependency since the test uses the QStyleFactory to create the style, and if that fails, tests can be skipped at runtime. As a consequence of not being executed in CI for a long time, many tests failed. Also, many tests were commented out or skipped as broken, ambivalent, or nonsensical. Remove that dead code. The QGraphicsWidget::initialShow test doesn't test anything that initialShow2 doesn't test, but makes incorrect assumptions, so remove it and rename initialShow2 to initialShow. Failing tests frequently left QWidget objects undeleted, causing all subsequent tests to fails as well. Fix that with std::unique_ptr. Some tests are still unstable and fail on some platforms, handle that using QEXPECT_FAIL. The forwardTouchEvent test fails due to a bug in Qt introduced recently. Skipping it for now. Change-Id: I405122ea9d4d150bd1d505d40b83fe39604de0f9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a49ba9265f90a5561351de2b47c6082b267f43b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Enable building and uploading tests for Android targets if tests enabledAssam Boudjelthia2021-08-301-2/+1
| | | | | | | | | | | Enable building and uploading test artefacts for all modules in case tests are enabled. Task-number: QTBUG-88846 Change-Id: I30832820dea348187b517e170fa1c5266db85604 Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit d9381bc7c36bf31d9496e20425968dafeee855be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* TLS plugins: Prefix with 'q'Mårten Nordheim2021-08-308-8/+8
| | | | | | | | | For consistency with other plugins. Change-Id: I45507389a42e645c94f1ca3f32262a2181f282f7 Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 522ca997d3baab1b88f454bbeea9f357d3969dff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Conan: Rename 'extra_cmake_args' Conan option as 'cmake_args_qtbase'Iikka Eklund2021-08-301-5/+5
| | | | | | | | | | | | | | | | | | | It turns out that we need to support two ways to pass cmake args as Conan options. Those that are meant for qtbase only, like "-DCMAKE_TOOLCHAIN_FILE={{.Env.ANDROID_NDK_ROOT}}", and those that are meant for leaf modules only. Rename the current 'extra_cmake_args' Conan recipe option as 'cmake_args_qtbase' to make it clear these cmake args are passed to qtbase build only. The leaf modules will be using 'cmake_args_leaf_module' as the Conan option name. Change-Id: I456b8b07da5684f386cac668a5cd3e2509c733ac Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit 83752fcd2b8104df8d17f24640c14a307eac46fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Conan: recipe cleanupsIikka Eklund2021-08-301-33/+65
| | | | | | | | | | | | | - Fix license reference in the recipe. - Fix line lengths exceeding 100 characters. - Code formatting changes as suggested by 'black' tool. - Remove superfluous Path() usage. - Improve Qt version parsing from file. Change-Id: Ie0534a1d4fb7b2c1dc697117bd4cb2d4ceda0622 Reviewed-by: Toni Saario <toni.saario@qt.io> (cherry picked from commit 122a45cd733d8b5acc10ccb77225e6826419d764) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: pass -g to testrunner to grant run time permissionsAssam Boudjelthia2021-08-291-1/+1
| | | | | | | | | | | | Some Qt modules/tests go through features that require run-time Android permissions which are granted by user input, that of course is not ideally possible while running unit tests. So when installing the app adb can do that for us. Change-Id: I92d33d5213c3779d7ca246ec0fb359d2ead4fa6f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 07283f15272d4d926fc730f5f2164fbe736f0d89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Hide mouse cursor when initiating IM enabled text inputTor Arne Vestbø2021-08-281-0/+13
| | | | | | | | Fixes: QTBUG-72744 Change-Id: I952710e88a11fd00498562c9011461a010f02f7b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 52f635b9a0e1fe074bf39b49b25d3ef3f6484676) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Correctly implement attributedSubstringForProposedRangeTor Arne Vestbø2021-08-281-6/+36
| | | | | | | | | | | | | | | | | The substring range refers to the entire text of the focus object, not just the selection. As there is no way to pull out the entire text via input method queries we do the best we can via ImTextBeforeCursor and ImTextAfterCursor. Returning the correct substring enables input method features such as backtracking into already committed text with the Hiragana IM, as well as the Keyboard Viewer's 'Current Text' toolbar. Change-Id: I53286ef1e8e7c5fba37858dda7317ae74d95b528 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3de396590cb41ddf05f91dfb1d2db8c1fe34ff56) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Assume input method handles key eventTor Arne Vestbø2021-08-282-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When input methods are enabled for the focus object we send key events through interpretKeyEvents, which will involve the input method in the key event processing. The input method will get back to us with callbacks such as insertText, setMarkedText, or doCommandBySelector. In the case of insertText, when the inserted text matches the originating key event's text, we opt to not send the text as an QInputMethodEvent, and instead fall back to sending it as a normal QKeyEvent. The reason for this is that Qt's IM protocol was designed to handle composited text, so sending non-composited (but IM-initiated) text input as IM events is unexpected (see 2d05d3bd2815c220474b3c07bf3f2ef7417d3070). However, we cannot assume that the input method will always call us back with one of the above mentioned methods. The input method can very well eat the event as part of its own operation. This happens for example when pressing and holding 'a' in a US English keyboard layout, which will pop up an input panel for the various accents available. Or it may happen when using the AquaSKK third party IM, which uses the 'l' key to switch the input mode to latin without producing any characters. To allow these input methods the freedom to control the processing of key events we need to reverse the logic for when we send key events as QKeyEvent. We now assume that the IM will handle the event, and only trigger QKeyEvent in two cases where we explicitly were called back by the IM, but decided that a QKeyEvent is needed: - If the IM calls insertText and we consider the text simple text - If the IM calls doCommandBySelector and we can't find a matching selector for the command. We only implement insertNewline and cancel, so in all other cases we want to pass on the key event to let the focus object handle it, for example for 'Select All' and similar key combinations. Fixes: QTBUG-46300 Fixes: QTBUG-71394 Inspired-by: Vladimir Belyavsky Change-Id: I9a73a8e1baa2ebe0c5df1166a9ec3d9843632bb1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 9e1875483ceaf907226f84cd6a58ab59f7f16f80) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Handle IM insertNewline by sending synthetic Qt::Key_ReturnTor Arne Vestbø2021-08-273-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the input method, pressing enter may result in simply dismissing the input method editor, without confirming the composition. For example with Hiragana, pressing 'a', then 'Tab', and then 'Enter'. In other cases it may confirm the composition as well, for example with Hiragana, pressing 'a' and then 'Enter'. And in some cases the IME will produce an explicit new line, for example with US English, pressing '~' and then 'Enter', or with 2-Set Korean, pressing 'a', then 'j', and then 'Enter'. Semantically, the input method has then asked us to insert a newline, and we should probably do so via an QInputMethodEvent, either directly or via [self insertText:@"\r"]. This is also how NSTextView handles the command. But, if we did, we would bypass all the code in Qt (and clients) that assume that pressing the return key results in a key event, for example the QLineEdit::returnPressed logic. To ensure that clients will still see the Qt::Key_Return key event, we send it as a normal key event. But, we can not fall back to handleKeyEvent for this, as the original key event may have text that reflects the combination of the inserted text and the newline, e.g. "~\r". We have already inserted the composition, so we need to follow up with a single newline event. Task-number: QTBUG-39125 Change-Id: If1e95687e6d5b06011692175a325f457b0b8a72f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f97e9360496eafe0425897b4aa07028965584cba) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix deprecation of QMouseEvent::source() and flags()Shawn Rutledge2021-08-272-1/+3
| | | | | | | | | | | Amends 53496e67f0b78645c6080e9218c7a36bc5a9d76d: - move flags() out of the QT_DEPRECATED_SINCE block in the header - add QT_DEPRECATED_SINCE block around source() implementation Change-Id: Id52fa6b04a13efbede3e6ac440060f90b283e773 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ba8f9d8d92ba4fd9aaf6e0885b56b56e25acfc45) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update Android default SDK from 29 to 30Juha Vuolle2021-08-275-5/+5
| | | | | | | | | | | | By the time of Qt 6.2 release all new apps targeting Play store must target API level 30 (Android 11) or above (starting in 08/2021 for new apps and 11/2021 for existing apps' updates). Task-number: QTBUG-94451 Change-Id: Id7fa2fd62899a7259e365c917292c6c3ac0d2b0d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 17d7a8dc2e2df577a769cd84cba946a726e8872a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make clear why QTestLog::addB?XFail() don't add to countersEdward Welbourne2021-08-273-8/+10
| | | | | | | | | | | | | | This reverts commit 904617dfb83f39a6a379635b64fea6fcd00f241a and makes clear to future readers why that wouldn't be a sensible change. Update the test's data, eliminating a case of duplicate counting that was caused by the reverted commit. Task-number: QTBUG-95661 Change-Id: Ice6d3ab06ca171e0d6eb0fac757f1ab774e229f0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 7af79ba09148dbfe5c1fc8b130d564dcca7ae4b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Handle replacement range during marking of textTor Arne Vestbø2021-08-271-0/+16
| | | | | | | | | | | | | The input method may include already committed text when marking text, in which case the replacement range reflects the position and length of the existing text. We handle this the same way we do replacement ranges in insertText. Change-Id: I148e4701318a59c7e0d9441d157199d7c8606f43 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a56b915f71eb5ceb10b6c2c585eefb88657f4abf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Factor out key event handling into helper structTor Arne Vestbø2021-08-272-72/+140
| | | | | | | | | | | | This allows us to share code between handleKeyEvent: and flagsChanged: for parsing the incoming NSEvent, and allows for sending key events from other call sites in the future without duplicating the parsing and sending logic. Change-Id: Ic63f740523496a9432e439663a20f78b5bc234c5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f563203f60f2cb4d03650af3a357e988aa6bce32) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Return early from key handler if shortcut was handledTor Arne Vestbø2021-08-271-7/+3
| | | | | | | | | The code paths after accepting a shortcut event can never be hit. Change-Id: Ida77417adb8fcfd25a4b20c4eb86056b3769f014 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 2945c6223bf067f240a020b2454d6bcac8fa961a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: gl: Set the screen on the context, if possibleLaszlo Agocs2021-08-271-0/+2
| | | | | | | | | | | | | | | | | | | | | Take the screen from the window, if the window was specified. When it comes to Qt Quick, this is in fact required in order to make the behavior on par with Qt 5, see https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgthreadedrenderloop.cpp?h=5.15#n1336 try to mirror that in Qt 6 as well. There are still subtle differences between Qt 5 and Qt 6 in particular when qt_gl_global_share_context is set (do we set the screen from that or from the window?), for now leave that question unsettled. What exactly setting the screen on the context does is platform specific, and can become relevant with multi screen, multi GPU systems. Change-Id: Icc90b8fea87bf1e34ecf1dec0702f4d3c411db00 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 8043a1a75aedc89af53859d187632fab7ed83f46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Call MinGW's ld with -Bstatic when requesting static runtime linkageJoerg Bornemann2021-08-271-1/+1
| | | | | | | | | | | | The -static argument we used before is supported by ld, but not lld. The latter requires --static or -Bstatic. Use -Bstatic, which is supported by both. Fixes: QTBUG-89549 Change-Id: I3c3069661bf4cd20e3298aff4714163b7419d3ef Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d94652f7927945f988f2c99cee98076efd5c1d79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QToolButton: reimplement the fix for QTBUG-95255Giuseppe D'Angelo2021-08-272-7/+10
| | | | | | | | | | | | | | | | | | The code in 188d739400e10fc8571bbf2ec86d5cd338b04a5d uses a connect() to a lambda, passing UniqueConnection to avoid establishing the connection more than once. The problem is that UniqueConnection does not work with lambdas; it works only with "regular" PMFs to QObject subclasses. Re-do the same fix, but without a connection: use the checkStateSet() virtual from the base class that will notify us if setChecked() is being called on the tool button, and from there synchronize the state of the default action. Change-Id: Id512812c562cd6d20bc1a489753b33c269919d32 Fixes: QTBUG-95255 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit c9830c2fb902f26dc8b2df61dfadc2d7a7d2b30e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmake/vcxproj: Read C language standard from QMAKE_CFLAGSJoerg Bornemann2021-08-271-0/+16
| | | | | | | | | | | | | | | | The vcxproj generator completely ignored QMAKE_CFLAGS and did only read QMAKE_CXXFLAGS. The msbuild-internal "cl compiler tool" contains the flags for both, C and C++. It is to risky to take all QMAKE_CFLAGS into account for the "cl compiler tool", because this might collide with what is specified in QMAKE_CXXFLAGS. Therefore, we only read the /std:... compiler option from QMAKE_CFLAGS and set the LanguageStandard_C flag in the msbuild file. Task-number: QTBUG-89296 Change-Id: I885061802c1350b293a7868d4c9a9367d30e2380 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a6a216e31041f6c878a37d9af169f221d99978c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmake: Make it possible to set CONFIG += c11 with MSVC 19.28Joerg Bornemann2021-08-271-0/+6
| | | | | | | | | | | | | The compiler that comes with Visual Studio 16.8 added support for setting the C11 standard with the /std:c11 flag. Add the respective version check in msvc-version.conf and set MSVC_VER and QMAKE_CFLAGS_C11 accordingly. Task-number: QTBUG-89296 Change-Id: I29b54ee073a765918f5aa4ebb081b97c5cf471d7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8914f80b278c030b2a6cc505e809b51920e178ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmake/vcxproj generator: Handle C standard compiler flagsJoerg Bornemann2021-08-273-6/+37
| | | | | | | | | | | | | | Handle the compiler flags /std:c11 and /std:c17 and turn them into the values stdc11 and stc17 for the LanguageStandard_C tag. Drive-by change: Add /std:c++20 to the list of known C++ standard options. Task-number: QTBUG-89296 Change-Id: Ia575fff611bdf795406db84bd34057d008c8a383 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5e98769602c1e7aa6ceeb45ffeee1680c58f4cda) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmake: Recognize MSVC 16.x as VS 2019 in the VS project generatorJoerg Bornemann2021-08-271-27/+31
| | | | | | | | | | | | | | | In a subsequent comment we will set the qmake variable MSVC_VER to 16.8 to check for the availability of certain compiler flags that were introduced in that compiler version. The old code compared exact version strings. With this patch we're checking version ranges instead and handle MSVC_VER 16.x as VS 2019. Task-number: QTBUG-89296 Change-Id: I9ea24a66f68a342a72f5c2a285bafacb8786661b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b073de274dfe0419b1e8a4f5262b11078fde88e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Warn when PRIVATE_MODULE_INTERFACE is provided with no targetAlexandru Croitor2021-08-271-2/+10
| | | | | | | | | | | | | Warn if the PRIVATE_MODULE_INTERFACE option is provided a value, but there is no ${target}Private target to set the interface dependencies on. Task-number: QTBUG-95921 Change-Id: I7d4df9cb3aa9b7746d836b82019ecdd9c8f50fdc Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 0dbf73e3deb9727da0376abf131d764251969114) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Check QMake support for building apps on INTEGRITYTatiana Borisova2021-08-271-0/+4
| | | | | | | | | | -Add integrity QMAKE_* paths for SA8155P device Task-number: QTBUG-95671 Change-Id: Ife60cf2db74bfd0c47103e2dd6aaa73609d856d2 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> (cherry picked from commit 664a7947beb0a48990406f04ef50d28b6291f860) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Check NSEvent.characters to determine dead key stateTor Arne Vestbø2021-08-271-2/+3
| | | | | | | | | | | | | | | We map NSEvent.characters to text that we pass on in our QKeyEvent, but for Qt 4 compatibility we explicitly skip function keys and arrow keys, as the text these events produce are control characters. See 4dbce2a469608194527188a136baa3e812caf361. However, these keys are not dead keys, so we can't use the resolved text we're planning to pass on to Qt to determine if they are. Change-Id: Ib59f0489ae014379c699600f14634c55161ccc8a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit abdd52451978478234c2ae4d2a002c82e9d4b5fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Use current NSEvent to determine if IM text matches key eventTor Arne Vestbø2021-08-273-13/+17
| | | | | | | | | | Gives us one less state member to worry about in the IM machinery. Task-number: QTBUG-35700 Change-Id: Iaa06b29015f9b9594b8107b74a8931f076a26e12 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 294e4c7aa8cacd63c01d3836ce06c1f2d8c5ad5c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Build a subset of tests when targeting iOS in the CIAlexandru Croitor2021-08-279-4/+153
| | | | | | | | | | | | | | | | | | | | | | | | | Add infrastructure to build cmake auto tests in the CI when targeting iOS. Currently the are only CI instructions for qtbase. More work is needed to make it work for other repos. With this change, we will build a single Widgets application targeting the iOS simulator. We can't target the device SDK in the CI because signing fails due to a missing signing certificate and provisioning profile. The Coin instructions will now set a QT_BUILD_ENVIRONMENT=ci env var whose value will be checked in _qt_internal_test_expect_pass, to ensure we build for the simulator SDK when using a universal Qt. Without this, xcodebuild will try to build with the device SDK and fail to build the project. Task-number: QTBUG-95839 Change-Id: Ib39c9527b107b2004746ccbdc9d9d1d658f88c76 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 80705298ca11587782beed49c4ae55f533cfc0c2) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Make _qt_internal_test_expect_pass more configurableAlexandru Croitor2021-08-271-6/+84
| | | | | | | | | | | | | | | | | | | Introduce new options: NO_CLEAN_STEP, NO_BUILD_PROJECT_ARG, GENERATOR, MAKE_PROGRAM, BUILD_TYPE. If cache or env var QT_CMAKE_TESTS_ADDITIONAL_CONFIGURE_OPTIONS is provided, the value is interpreted as a list of additional configure arguments to pass to the built project. Also skip adding a test command if there is no BINARY or BINARY_ARGS option provided. Change-Id: I3a1d82b41a734dcd3f473e59cc64efd00363e49b Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1f3949a5a8182aee4047fcf73413f67c613cbb86) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix indentation in _qt_internal_test_expect_passAlexandru Croitor2021-08-271-11/+11
| | | | | | | Change-Id: Ib92bcd600bbfb0f2ee8ad8e5d44eaecdf9d16916 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit eb635dda1e19135a635b03a05c7582d1ec976c22) Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Android: Add information about who launched this activity to intentsLars Schmertmann2021-08-261-0/+18
| | | | | | | | | | | | * With this change, applications can easily determine the source of an intent without creating an own extension of QtActivity. * https://developer.android.com/reference/android/app/Activity#getReferrer() Task-number: QTBUG-84382 Change-Id: I6a5200af1d997640f02e2b934343914fb5f32ccc Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 0755eba5e8129ea536370c927ad9b0d034950a69) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: Polish some feature flag docsLaszlo Agocs2021-08-261-22/+37
| | | | | | | | | | | | | | | Clean a bit, also enhance, e.g. mention textureLod for TexelFetch which is how Quick3D uses it, and most notably expand the "in practice" notes. As no application or library can be expected to write fully conditional code based on all these flags, knowing when a certain feature is (un)supported in a real run time environment is essential in order to make informed decisions on when and in what manner (i.e. with or without conditions), rely on a given feature. Change-Id: I15ea34e11bd345b36248f92de9b1fdb1fdc3e8d9 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit ae306b1c5aecdeab726610bfb38600aca564cecb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* wasm: don’t dereference null reply pointerMorten Johan Sørvig2021-08-261-40/+33
| | | | | | | | | | | | | | | | | | | | Move all access to the reply inside the nullptr check, while making sure to still call emscripten_fetch_close() unconditionally where needed. Make all four Emscripten callback handlers have a similar structure where we check if the reply is not null and not in the Aborted state. (This removes one emscripten_fetch_t nullptr check in stateChage(), if it is really the case that Emscripten calls us with a null emscripten_fetch_t then we should add it back.) Change-Id: Iadcbe6338c338cfeb8967490e0951d8b3e1ec5b3 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit 8585cd2483009b0dcd9ef275da3588e80acc522a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLocale: improve documentation snippetIvan Solovev2021-08-261-9/+11
| | | | | | | | | | | | | QString::toDouble() now always uses C locale, so the previous code snippet does not make much sense, as the results do not depend on the selected default locale. The updated snippet uses the default locale, which allows to show the difference between locales. Change-Id: I76a00429fa5b75cf109cf45bc25280a7fd427e0f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 7729989648d85aa17aa5a7cde48dacdd377b962b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* rhi: gl: Allow passing in a custom shareContextLaszlo Agocs2021-08-263-3/+14
| | | | | | | | | | | | | | | | | We already honor AA_ShareOpenGLContexts and pass in the QGuiApp's context as the shareContext for the QRhi's QOpenGLContext. Extend this to also allow specifying a QOpenGLContext in the init params struct. A good example of this is the backingstore compositor that serves QQuickWidget and co. If one wanted to implement that with (an OpenGL-based) QRhi, instead of direct OpenGL calls, then the ability to create a QRhi that uses a context that shares resources with a given other context becomes essential. Change-Id: I6bc5ff8e803d467f8795197ac1f12fdc0f73bbd1 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit afa0ce90451c4c939c91c9ef157e1d60e4906085) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>