summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* rhi: vk: Fix invalid index for unused attachmentsLaszlo Agocs2021-09-231-12/+14
| | | | | | Pick-to: 6.2 Change-Id: I8140de4eeb1a8a490fcffd10370c29a49d677fed Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* macOS: Handle window titlebar buttons independently from style maskTor Arne Vestbø2021-09-233-36/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Style masks such as NSWindowStyleMask{Resizable,Miniaturizable} affect whether the window has a title bar button for the action, but also whether the window can be resized or minimized through other means, for example if the window border can be dragged to resize. By decoupling the visibility and enablement of the title bar buttons from the style mask we can individually control the buttons, and leave the style mask set to enable behaviors we always want. We were already doing this for the NSWindowZoomButton. Unfortunately AppKit not only checks NSWindowStyleMaskMiniaturizable during a call to miniaturize, but also whether the title bar button is enabled. To allow minimizing windows without the titlebar button we detect the situation and give AppKit a NSWindowMiniaturizeButton that we haven't disabled. The alternative would be to temporarily enable the NSWindowMiniaturizeButton during the minimize, but this results in the button flashing yellow for the duration of the animation. Task-number: QTBUG-65637 Task-number: QTBUG-46882 Task-number: QTBUG-64994 Task-number: QTBUG-71485 Change-Id: I2c1a9564d8b7516476aa018b2820670199124bc2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFileSystemWatcher: fix QWindowsFileSystemWatcherEngine crashesTim Jenssen2021-09-231-1/+2
| | | | | | | | | | | | | | | | | | | | Since QHash in Qt6 does not guarantee stable iterators after an insert it crashed from time to time. - possible crash at the erase call if pit is invalid - possible crash at insert if pit is invalid QHash<QString, int> myHash; auto i = myHash.find("foo"); myHash.insert("foo", 789); i.value(); // possible crash myHash.erase(i); // possible crash Task-number: QTBUG-96790 Change-Id: Ia9b53d46b8d1fef81ab5a130c229bc9e936f6521 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e60951eef4f0ade944e2f93ffe2f44abfc76d97a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document QAbstractTestLogger's virtual method APIEdward Welbourne2021-09-231-3/+209
| | | | | | | | Provide the information an implementor needs in order to be able to implement an logging backend. Change-Id: I7bb522de57149dad843e01a8afa9f8891d011d29 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Deprecate QTest::qWarn() and replace its last useEdward Welbourne2021-09-232-14/+10
| | | | | | | | The one place that actually called it with file and line number was internal to QtTest, so could call QtTestLog::warn(). Change-Id: I8be10fc81996cc3de4d2eea3ecedc59671ffe759 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QTest::qWarn() with qWarning()Edward Welbourne2021-09-232-7/+7
| | | | | | | | | | | | | It's the recommended replacement when file and line aren't known, and simplifies the code in any case, thanks to taking format and varargs. It incidentally also enables tests to tell QtTest's custom message logger to anticipate its warnings, when they arise. Fixes: QTBUG-67702 Change-Id: I10c883f4dd0b69dca6e59e0dbd55ab318f1938f4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Convert all QT_VERSION checks to compare against QT_VERSION_CHECK()Edward Welbourne2021-09-232-5/+6
| | | | | | | The result is generally more readable. Change-Id: I507f67954ecd38516de1b7a6f8244c233ee45ddf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove fatuously true or false QT_VERSION checksEdward Welbourne2021-09-232-41/+1
| | | | | | | | | QT_VERSION is now at least QT_VERSION_CHECK(6, 3, 0), so remove all checks against Qt 6.0.0 or earlier. They are superfluous. Tidied up in some places in the process, particularly #include order. Change-Id: I2636b2fd13be5b976f5b043ef2f8cddc038a72a4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add some debug warnings to the GL paint engine regarding stencilLaszlo Agocs2021-09-231-0/+8
| | | | | | | | | | | There is absolutely nothing we can do if the render target has no stencil buffer, but print at least a warning in debug builds to give a hint to the developer. Pick-to: 6.2 Task-number: QTBUG-96786 Change-Id: If7f84f28f9bc9b3dadd01d0816c8db4015a1db0b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMessageBox: read geometry from the screen the message box belongs toRichard Moe Gustavsen2021-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The current implementation found a QScreen by using the position of the mouse in a call to QGuiApplication::screenAt(). From the documentation, this function is allowed to return nullptr if the position is outside the screen. From the stack track in the bug report, it seems very likely that the mentioned call returns nullptr. This is strengthen by the fact that the crash happens for messageboxes that are maximized, so that you need to click on the upper corner of the screen to close it. And then only when HiDPI scaling is in use at the same time. This patch will change the code to just use the screen that the widget is on instead. If no screen can be resolved, the call will default to primary screen. Fixes: QTBUG-96639 Pick-to: 6.2 Change-Id: I31f0301318b358be9619caa31cc831b9598d5f90 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cocoa: Don't call makeKeyAndOrderFront for native app-modal dialogsDoris Verria2021-09-232-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | We show non-modal and Qt::WindowModal native dialogs as modeless panels by calling makeKeyAndOrderFront on the panel. When we exec() a dialog on the other hand, we start a modal event loop by calling runModalForWindow. This method will display the dialog and make it a key window before running the modal event loop. So we don't need to and shouldn't call makeKeyAndOrderFront explicitly before that. Doing so will make Cocoa lose the reference to the previous active window (as it maintains only one level of previous active window) and wrongly choose the main window as key after the dialog closes. Avoiding the call to showModelessPanel for Qt::ApplicationModal dialogs fixes it. Also, in order to display a modal when show() is called and app modality is set via setModality, display it as a modeless dialog as well. This keeps the same behavior we have currently, but it is still not the right way to handle it as we don't respect the modality set by the user. A clean-up of that logic to come in a follow-up commit. Fixes: QTBUG-42661 Pick-to: 5.15 6.1 6.2 Change-Id: I8f33e3866b191d775a64a5d9ec3dd65736114e62 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Change NSTrackingArea to use NSTrackingActiveAlwaysRichard Moe Gustavsen2021-09-234-38/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation configured NSTrackingArea to be active while the application was active (NSTrackingActiveInActiveApp). But because of a bug in AppKit, the tracking area would sometimes stop being updated, with the result that no mouse events was being sent from AppKit. One way to trigger this bug would be to deactivate the app using cmd+tab (fast enough so that the task switcher is not showing), and reactivate it again using a mouse click. To work around this issue, this patch will instead configure the tracking area to always listen for tracking events, even when the application is inactive (NSTrackingActiveAlways). By doing so, we bypass the apparently broken behavior in AppKit related to activation. The downside is that we then also get tracking events while the application is inactive, which is against how Qt should work. So we therefore need to now check if the application is active before we forward any tracking events to QWSI. With NSTrackingActiveAlways we no longer get enter/leave events from AppKit when the application is activated/deactivated and the mouse stays on top of the application, so we now also need to handle this explicitly from the application delegate. Since we already need to keep track of which QWindow is under the mouse to be able to send out enter/leave from mouse moves, we use the same variable (s_windowUnderMouse) for this purpose as well. Because of QTBUG-35109, there was already a code path in QCocoaWindow that sent out an enter event when a window became key. This is no longer needed now that we send out enter/leave when the application is activated/deactivated. It's also questionable if sending an enter event based on a window's key status is correct, since we in Qt should also send out enter events for inactive windows. So we remove this code path since it interferes with (both the old and) the new implementation. Fixes: QTBUG-36926 Task-number: QTBUG-94447 Change-Id: I5c1105bc3102925c9c65964b4a7d1e02efd01735 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add private qAbort helper functionTor Arne Vestbø2021-09-223-25/+35
| | | | | | | Used from qt_message_fatal(), but is useful in other situations too. Change-Id: I3c0e438536d40271061c76d954c7878abfe37b8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-222-3/+3
| | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Pick-to: 6.2 Task-number: QTBUG-95018 Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* macOS: Fix logic for determining NSWindowStyleMaskTitled/BorderlessTor Arne Vestbø2021-09-221-11/+32
| | | | | | | | | | | | | | | | We were working under the assumption that the NSWindowStyleMaskBorderless style mask excluded all others, on account of having the value 0. But in practice this does not seem to be the case, and you can combine the mask with many of the other masks. The only mask that is mutually exclusive with the borderless mask is NSWindowStyleMaskTitled (with a value of 1). Clarify this be restructuring QCocoaWindow::windowStyleMask(). Task-number: QTBUG-71485 Change-Id: I4bbd603fd2373c11f76e84b72a2a60aa2356b032 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Document qt_add_library() and update related docsCraig Scott2021-09-234-13/+186
| | | | | | | | | Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: Ib107110457380a2bb30876cf2c565f0c8e8c5e9c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add docs for qt_add_plugin()Craig Scott2021-09-233-9/+88
| | | | | | | | Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: Ifdc10c7714e91f6211a52bd5c46b3140485bbb43 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove spurious QTestResult::setCurrentTestData(nullptr);Edward Welbourne2021-09-221-1/+0
| | | | | | | | | Calls to QTestResult::setCurrentTestData() are handled via an RAII class, QTestDataSetter, that ensures this final call passing nullptr was redundant. Change-Id: I7788e3ce898e5628d5590ef9d34182f05e85fe50 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QThreadPrivate: Remove threadForIdFabian Kosmale2021-09-221-3/+0
| | | | | | | | | The thread build variant is not implemented; the no-thread one simply returns the current thread. As this has no utility at best and misleading at worst, remove those functions. Change-Id: I93ee45ae7d55e3a7ad1f03168b14149a5d4c9253 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add isValidUtf8() methods to QUtf8StringView and QByteArray{,View}Ievgenii Meshcheriakov2021-09-227-0/+50
| | | | | | | | | | | | | | | The new methods return true if the string contains valid UTF-8 encoded data, or false otherwise. [ChangeLog][QtCore][QByteArray] Added isValidUtf8() method. [ChangeLog][QtCore][QByteArrayView] Added isValidUtf8() method. [ChangeLog][QtCore][QUtf8StringView] Added isValidUtf8() method. Task-number: QTBUG-92021 Change-Id: I5d0cb613265d98b1f189c5f5cc09c1f7db302272 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInformation: Request all supported feature when loading by nameMårten Nordheim2021-09-221-1/+1
| | | | | | | | | | | | | When we load by name we used to pass an empty QList to the backend as the list of requested features. That's not ideal if a backend were to selectively initialize components, so let's just pass the list of supported features. Not a problem in any current backend but it looks weird. Pick-to: 6.2 Change-Id: Ib022778b08d32e4057103a86bfdda9e17e6ebdaf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove redundant semi-colonsAllan Sandfeld Jensen2021-09-222-5/+5
| | | | | | | | Causes warnings with clang-cl Change-Id: I57395819debe07aecd045c5a8c747632e6c04fc1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLocalSocket: reorder device closingAlex Trotsenko2021-09-212-2/+4
| | | | | | | | | | | To allow reading from a slot connected to the aboutToClose() signal, we should call QIODevice::close() just before closing the inner device. This patch amends 21f3ff65b8df777b5726a68b09bbee39f1a893ec. Pick-to: 6.2 Change-Id: Ic8cd00497e1bdf923b980c26e9ca874b77e82f89 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix loading certificates on Android with OpenSSLMårten Nordheim2021-09-211-2/+3
| | | | | | | | Fixes: QTBUG-96606 Change-Id: Ic2a55fa65c5dc3c057a4da25c218af5a9861410e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 504df6b135d4ac17aa2290e1aa943d216fb7ef55)
* macOS: Don't re-send key event through input method on focus object changeTor Arne Vestbø2021-09-211-9/+0
| | | | | | | | | | | | | | | | | | | | | | | In 0c2ca26cd9583092f3ade7b18bc2423336a6202b we started re-sending the key event through the input method when we detected a focus object change, to support the use-case of QAbstractItemView opening an editor and changing focus in response to the first QEvent::InputMethod event. Unfortunately this doesn't work as a general approach, because we don't know what the reason was for the change in focus object. For example, a client might respond to a Qt::Key_Return press by changing the focus to the next input element, and re-sending the key event would in that case insert a new-line in the new focus object -- counter to the expectations of the client. Since we can't know the reason for the changed focus object we can't assume re-sending the key event is safe. Task-number: QTBUG-54848 Fixes: QTBUG-96726 Pick-to: 6.2 6.2.0 Change-Id: Iea8b166385925cd1a05ef62d5cf763638d9f8a67 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QVariant::Private: select storage in get at compile timeFabian Kosmale2021-09-211-1/+1
| | | | | Change-Id: I82b0a7ec28400dac64ea785ba6766ca488e615aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: write less haphazardly to dataFabian Kosmale2021-09-211-2/+2
| | | | | | | | While the data subobject is at the same position in memory as the QVariant::Private, using d.data actually activates the union member. Change-Id: Ie6879b588c8e830ae8b34cfcd8e9ddff8b60b3a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qmetatype: Fix operator< detection for std::optionalFabian Kosmale2021-09-211-0/+2
| | | | | | | | | | Amends ca54b741d6edda24773137aacee229db31dd3585. operator< is not constrained in MSVC's standard library, either. Pick-to: 6.2 Fixes: QTBUG-96690 Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cater for upstream changes in eglplatform.hLaszlo Agocs2021-09-212-1/+6
| | | | | | | | | | | | | EGL_NO_X11 has been replaced with USE_X11, thus breaking all existing code out there, including Qt: https://github.com/KhronosGroup/EGL-Registry/pull/130 Fix this by defining USE_X11 whenever we do not define EGL_NO_X11. Fixes: QTBUG-96392 Pick-to: 6.2 Change-Id: If8b68caa8c9022477d87169ca2e2a0121a9313e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Improve version-related docs in qglobal.cppEdward Welbourne2021-09-212-23/+25
| | | | | | | | | | Give a more pragmatic illustration for QT_DEPRECATED_BEFORE. Make various minor tweaks to wording, use slightly less antique versions in examples. Make usage of "runtime" standard in qglobal.cpp, at least, since "run-time" seems to be less used generally. Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QProperty: attempt to fix compilation with GCC 10Thiago Macieira2021-09-211-1/+1
| | | | | | | | | | | | Somehow it's not expanding properly in constexpr time. qproperty_p.h:554:30: error: \u2018(QItemSelectionModelPrivate::modelChanged != 0)\u2019 is not a constant expression if constexpr (Signal != nullptr) { ~~~~~~~^~~~~~~~~~ Fixes: QTBUG-96659 Change-Id: I3eb1bd30e0124f89a052fffd16a69d2eb4b45784 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QWindow respect minimumSize again on WindowsMorten Johan Sørvig2021-09-211-0/+2
| | | | | | | | | | Commit 6336b535 accidentally removed a call to applyToMinMaxInfo(). Add it back. Task-number: QTBUG-96441 Pick-to: 6.2.0 6.2 Change-Id: I26a5d121ed3b4cd9e49e3dd8b371abe71d9a482c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Repair broken link to the XDND protocolLuca Di Sera2021-09-211-1/+1
| | | | | | | | | | | | | | The documentation for QTGUI's `Drag and Drop` links to the XDND protocol, which is used to manage Drag and Drop on X11. The previous link seems to have been broken for a few years and was thus replaced with a link to XDND on Jhon Lindal's site, who is the author of the protocol. Task-number: QTBUG-96127 Pick-to: 6.2 6.2.0 Change-Id: Ia46b10c7461129491934eb74355f107f96e04383 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Refactor QWindowsPipeWriter::writeCompleted()Alex Trotsenko2021-09-211-5/+4
| | | | | Change-Id: Id44215d6a96e7841330181c94cc54b6b677a153d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Add docs for qt_allow_non_utf8_sources()Craig Scott2021-09-213-3/+55
| | | | | | | Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: Ie09785ced5b2bf8098ccff3467f32244f32f9195 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add docs for qt_disable_unicode_defines()Craig Scott2021-09-212-1/+53
| | | | | | | Task-number: QTBUG-95712 Pick-to: 6.2 6.2.0 Change-Id: I37a50d9e8a62c7d9c30014692d99ffe2eb9b90fb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* 3rdparty: Fix forwards-compatibility bug in bundled xinput xcb modulePovilas Kanapickas2021-09-203-25/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | libxcb thinks that it knows about all device class types sent by the X server XInput extension. With the addition of touchpad gestures in XInput 2.4 and X server 21.1 this is no longer the case and libxcb fails horribly by thinking that the protocol was malformed. The X server currently has a workaround, but it would not address the following situation: - there are multiple modules within the same X client (e.g. part of the application uses Qt, another part talks to X server via another library) - both of the modules talk to XI - at least one module requests for XI 2.4 protocol support. The request for XI 2.4 disables the workaround on the X server and Qt side would crash horribly. This bug is being fixed upstream in these MRs: https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/merge_requests/23 https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/20 Change-Id: Idf345271340031152b512ef59f619313be5ec226 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QNetworkInfo(Win): cleanupsMårten Nordheim2021-09-201-4/+3
| | | | | | | | | One signal emission was not labelled emit. Removed some unnecessary braces Change-Id: I1c0adde869e559056e60671619bfca33b1966d1e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QNetworkInformation: Actually compare names case insensitivelyMårten Nordheim2021-09-201-1/+1
| | | | | | | | | The docs (10 lines above) say it will find the backend case insensitively. Thus the comparison should also be case-insensitive. Pick-to: 6.2 Change-Id: I65901ed81b7d8bdfcf76f5b6c7b40efe63245503 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QScoped(Array)Pointer: use the rule of 5Giuseppe D'Angelo2021-09-201-2/+3
| | | | | | | | | | | | CodeChecker complains regarding the two classes not having all the special 5 declared, so do it. Change-Id: I76d562c52f89a24aec9f155c2be62f8844f1f4a7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* DBus: do not mix QList iterators and raw pointersGiuseppe D'Angelo2021-09-202-7/+8
| | | | | | | | | | | | | In Qt 5, QVector::iterator was actually a raw pointer. In Qt 6, QVector = QList, and QList::iterator isn't a pointer, but converts to one (for backwards compatibility). Some code in QtDBus exploits this by mixing iterators and raw pointers. In preparation for deprecating conversions between them, adjust this code by "converting" explicitly when needed. Change-Id: I1efab72b33d27742b339cf848cefd5cc258cd215 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* uic: Add QWebEngineViewFriedemann Kleint2021-09-201-0/+1
| | | | | | | | | | This is required to generate the correct import for Python. Pick-to: 6.2 6.2.0 Task-number: QTBUG-63235 Change-Id: I6aaff82058e3f0a5453da15d8d470f06ad9a5a16 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Compile autotests for IntegrityTatiana Borisova2021-09-202-4/+5
| | | | | | | | | - process environment/DNS are OFF for INTEGRITY Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I189a97f88c96a428586c31a66b8d250e04482900 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix assorted misindented end-comment markers in qglobal.cppEdward Welbourne2021-09-201-14/+14
| | | | | | Change-Id: I240e7d32c4aa004f2bd7dd8cafd39b7c7d64e014 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Encourage use of QT_VERSION_CHECK()Edward Welbourne2021-09-203-15/+25
| | | | | | | | | | | | Document that QT_VERSION should normally be compared against it, rather than raw hex, and mildly update the example versions used in docs. (Left the snippets testing old version, since the code in which the #if-ery is used might actually make sense for those versions.) Improve related documentation in the process. Change-Id: Id3e97f41bfb0f81a117cf7b3a3ccd5f244e2a99a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QDateTimeParser's handling of 't' format to match serializationEdward Welbourne2021-09-201-1/+4
| | | | | | | | | | | | | | | | | | This amends commit 68f19fb630dc02463c2d61fc511de7407687795e to only consume one 't' from the format string, to match qlocale.cpp's serialization of time-zone specifiers, which only consumes one, so will repeat the time-zone specifier as many times as unquoted t appears in the format. It's hard to imagine why anyone would want this behavior, but it's what our serialization has always done and parsing should match serialization. Add test-cases for double time-zone specifier. Delete a lie in the process. Task-number: QTBUG-95966 Change-Id: I574896040a74085dee89a4fefd8384be44ad827b Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't bootstrap rccJoerg Bornemann2021-09-201-1/+0
| | | | | | | | The rcc tool doesn't contribute to the build of QtCore anymore. There's no need to link it against the bootstrap lib. Change-Id: I5272d439a05f852eeea88b3a6b95c5ad6dd4e987 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Remove Q_RELOCATABLE_TYPE for types with QVLA in themLaszlo Agocs2021-09-202-10/+1
| | | | | | | | | | | | | QVLA itself is non-relocatable due to self references. (ptr pointing to array[Prealloc] as long as capacity < Prealloc) Seems we shot ourselves in the foot in multiple places with this. Pick-to: 6.2 6.2.0 Fixes: QTBUG-96619 Change-Id: I57a2ce539b671326cd352dbe57a1f3d4c46a6456 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Introduce QDoubleValidator::setRange overload with two parametersIvan Solovev2021-09-202-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QDoubleValidator::setRange() used to have 3 parameters, with the third one (the number of decimals) having a default value of 0. Such default value does not make much sense for a *double* validator. Also, since a default value was used, omitting the decimals was silently overwriting the previous decimals value, discarding the value that could be previously explicitly specified by user. [ChangeLog][QtCore][QDoubleValidator][Important Behavior Changes] The QDoubleValidator::setRange() method now has two overloads. The first overload takes 3 parameters, but does not support a default value for decimals. The second overload takes only two parameters, not changing the number of decimals at all. Hence, the number of decimals will only be changed if the user explicitly specifies it. To maintain the old behavior of setRange(), pass 0 as the 3rd argument explicitly. Note that it is a source-incompatible change. But it should be fine, because using QDoubleValidator with 0 digits after decimal point does not make much sense and so, hopefully, is not that common. At the same time, change the default-constructed QDoubleValidator to use -1 for decimals, which allows arbitrarily many digits in the fractional part. The value was previously 1000, which allowed more than anyone would reasonably use, so this should make no practical difference. Some more unit tests to cover the behavior of the setRange() overloads are also added. As a dirve-by: remove unnecessary QValidator::State to int conversions in the unit tests. QCOMPARE is capable of comparing these enums and provides a better output in case of failure for enums. Task-number: QTBUG-90719 Change-Id: I523d6086231912e4c07555a89cacd45854136978 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Handle empty string args for versionless wrappers of dbus CMake commandsCraig Scott2021-09-201-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | CMake silently drops empty list items when passing ${someVar} to a function unquoted. The versionless wrapper functions typically use ${ARGV} or ${ARGN} to pass through arguments from the caller to the versioned implementation, but this doesn't preserve empty arguments. For qt_add_dbus_adaptor() in particular, this was problematic because that meant arguments after the empty arg effectively "moved left" and were interpreted as the wrong arguments. Use named arguments and pass through each one explicitly for the qt_add_dbus_adaptor(). This takes advantage of the implementation of the versioned function, which also checks each optional positional argument explicitly. We can only do this because we know the upper bound on the number of arguments, so it is possible to represent each argument with its own variable. A more general solution that didn't need to know the number of arguments would require the cmake_language(EVAL) command, but that requires CMake 3.18 or later. Fixes: QTBUG-96594 Pick-to: 6.2 Change-Id: Ibb1de19217191768ca5ead969b20a1d28c466868 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>