summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Always reset close-status of QWidget when trying to closeTor Arne Vestbø2021-09-151-5/+7
| | | | | | | | | | | | | | | | | Move the status setting and resetting back into handleClose so that we don't end up with it being set if handleClose is never called in response to a close attempt. This can happen when QWindow's platform window has already been destroyed. Since QWindow::close handles that case gracefully and returns true, we can safely call it multiple times. Add test coverage to verify that we get exactly those close event calls that we want. Change-Id: Ica77bf17c26d923c3b79b1e5a688addbc88a6277 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: convert mask region to native geometryMorten Johan Sørvig2021-09-152-2/+3
| | | | | | | | | | | QWindow::mask() returns a region in device independent geometry which can’t be used directly by the platform plugin. Pick-to: 6.2 5.15 Task-number: QTBUG-94770 Change-Id: I76279bc74cfabe315178327938f485f4447568be Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: don't block CMD+H while a popup is openVolker Hilsheimer2021-09-151-7/+2
| | | | | | | | | | | | | | | | | The shortcut hides the application, which works in native apps such as Xcode or Safari also while a popup menu (or combobox drop down) is open. This essentially reverts 29104c85db53e7c0c0aaf3fe78f84b737fce4886, which introduced the blocking of CMD+H to prevent the popup stack in the Cocoa plugin from going out of sync. With that stack gone after the previous commits, this is no longer a problem. Task-number: QTBUG-82626 Task-number: QTBUG-96450 Task-number: QTBUG-58727 Pick-to: 6.2 Change-Id: I35603d971741f03b793b7839b183b7ab37200647 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: remove the popup stack from QCocoaIntegrationVolker Hilsheimer2021-09-155-77/+2
| | | | | | | | | Since popup handling is now done exclusively by Q(Gui)Application, we don't need to keep track of the popup stack in the Cocoa plugin anymore. Fixes: QTBUG-96450 Change-Id: I869f36f52bc2210b6c92efd9425502de4122c553 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: remove mouse and key grabbing logic from Cocoa pluginVolker Hilsheimer2021-09-152-15/+0
| | | | | | | | | | For QGuiApplication with QWindow, no other QPA plugins do so, and for QApplication with QWidgets, QApplication implements popup functionality consistently. Task-number: QTBUG-96450 Change-Id: I47489296e0e470d8948ca7858d0a2608c58b2975 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Remove duplicate code closing popups on window interactionVolker Hilsheimer2021-09-154-36/+0
| | | | | | | | | | | | | | | | | | | After 70b94eea10d7af83cced09296755a8af28e167b5, all popups are closed on mouseDown within the window frame. As with native applications, the popup is closed on press, and before the press is delivered to the frame (ie before the jewel is shown as depressed). The previous notification handlers for window moving, minimizing, and closing can now be removed, together with the alternative implementation of closePopups that relies on the Cocoa plugin maintaining its own popup stack. This reverts 048e66a11d87845eaba9e8cf23de3fb4acac924d. Task-number: QTBUG-96450 Task-number: QTBUG-77833 Change-Id: I165f3caa64bf9a7b4c4d5455ca33e87029d75f73 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Use QGuiApplication popup APIs in Cocoa pluginVolker Hilsheimer2021-09-151-4/+3
| | | | | | | | | This removes more dependencies to the Cocoa plugin managing its own popup stack. Task-number: QTBUG-96450 Change-Id: Id01577739af525a34728f27b790b9aaac29705f2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make the closeAllPopup helper virtual in QGuiApplicationVolker Hilsheimer2021-09-153-11/+14
| | | | | | | | | | | | | | QPA plugins might have to close popups for events that are not delivered to QWindow or QWidget instances. For instance, the Cocoa plugin has to explicilty close popups when the user clicks into the window frame. Expose this functionality through a virtual in QGuiApplicationPrivate, and move the QApplication implementation from a static helper into the override. Task-number: QTBUG-96450 Change-Id: I52be5710c8d7515b9ae2e4bbadb069df4b3ed546 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* doc: use \note in QKeyEvent documentationTor Arne Vestbø2021-09-151-8/+8
| | | | | | Pick-to: 6.2 Change-Id: I0924f5a540ab5e58f7830c1af099ce6e44287811 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Allow finalizers to be delayed to later in the same directory scopeCraig Scott2021-09-161-0/+27
| | | | | | | | | | | | | | | | | | | | Deferred CMake calls are executed in the order they are created. Sometimes, a deferred call created after a call to qt_add_executable() or qt_add_library() needs to be executed before target finalization. For example, a file may be written using a deferred write, but the finalizers might need that file to exist. Provide an internal _qt_internal_delay_finalization_until_after() command that can be called to let finalization know it has to defer to later. Target finalizers will check an internal property for IDs recorded by that command and will re-defer itself if it detects that any of those haven't run yet. Task-number: QTBUG-96290 Pick-to: 6.2 Change-Id: Ia791e99339bab351eff0d675a552393e524490e8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* macOS: Compute NSWindow background color without checking styleMaskTor Arne Vestbø2021-09-153-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | The check for styleMask == NSWindowStyleMaskBorderless to decide whether to clear the NSWindow background was broken, as NSWindowStyleMaskBorderless has the value 0, but is only supposed to be compared to its companion NSWindowStyleMaskTitled (with value 1). A window can perfectly well be NSWindowStyleMaskBorderless and NSWindowStyleMaskMiniaturizable e.g., so by comparing directly to NSWindowStyleMaskBorderless instead of masking to the first bit first we ended up making miniaturizable windows non-translucent. We now check the Qt::FramelessWindowHint directly, and also whether the window is opaque. Ideally we'd have QWindow flags that could plumb WA_NoSystemBackground from Qt Widgets, as well as a background color property on QWindow to control the system background, but in the meantime we'll have to use the FramelessWindowHint heuristic. The QWidget docs have been updated to reflect this. Task-number: QTBUG-95042 Pick-to: 6.2 Change-Id: I0d40eecace60883c205ebb8c76cef1092cdf1144 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QEventDispatcherWasm: handle EventLoopExecMorten Johan Sørvig2021-09-152-0/+19
| | | | | | | | | Call emscripten_set_main_loop like the old GUI event dispatcher did, with one difference that requestAnimationFrame updates are now no longer handled by the event dispatcher. Change-Id: If02d90ae9c45d7b38999567d733a237af842cded Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QHighDpi::toNativeWindowGeometry()Morten Sørvig2021-09-151-7/+1
| | | | | | | | | This function implements the isTopLevel() logic, which we now don’t have to duplicate at each call site. Change-Id: Ic8b857aa7cd3c3c23d5e950d9f50b66c81ba3ccf Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QThreadPool: Fix restarting of expired threadsIevgenii Meshcheriakov2021-09-151-0/+5
| | | | | | | | | | | | | | | | Ensure that expired threads have actually finished before attempting to restart them. Calling start() on a thread that is not yet finished does nothing. Add a regression test into tst_qthreadpool that attempts to trigger reuse of expired threads and verifies that all submitted tasks execute. Fixes: QTBUG-72872 Pick-to: 6.2 Change-Id: I2109b628b8a4e91491115dc56aebf3eb249646b5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qlocale_mac: make sure that helper functions return QVariantIvan Solovev2021-09-151-25/+25
| | | | | | | | | | | | | | | | | | QLocale treats a null QVariant returned from the QSystemLocale::query() as a signal to fall back to CLDR implementation. In Qt 5 QVariant(QString()).isNull() was returning true, so we could easily return an empty QString() to fall back to CLDR. In Qt 6 the QVariant() behavior has changed. This patch makes sure that all the helper methods in macOS system locale implementation return a null QVariant() when they fail to provide any reasonable value. Task-number: QTBUG-84877 Pick-to: 6.2 Change-Id: I85be3b1463b1366f737e912c99bc11e37af98c62 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QAndroidSystemLocale: add missing day and month format handlingIvan Solovev2021-09-151-0/+12
| | | | | | | | | | | This patch adds support for previously missing Narrow format, as well as standalone day name handling for QAndroidSystemLocale Task-number: QTBUG-84877 Pick-to: 6.2 Change-Id: Ib74fb8f0e12f03ab96022abaf26ac9039ffaa60b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Teach QLocale::system() to use narrow formatIvan Solovev2021-09-155-20/+95
| | | | | | | | | | | | | | | | QLocale::system() was not making use of QLocaleFormat::Narrow, always treating it in the same way as QLocaleFormat::Short. This patch fixes the issue for day and month names. The implementation falls back to CLDR if system locale fails to provide some data. Pick-to: 6.2 Task-number: QTBUG-84877 Change-Id: Ia37e59dbf02d7a5e230f2767d294b9ab7de37f33 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix system locale instantiationIvan Solovev2021-09-151-1/+1
| | | | | | | | | | | | | | Construction of the static QLocalePrivate called defaultIndex() and systemData() in an implementation-dependent order, but defaultIndex() needs to be called after systemData(). So move the systemData() call that's used to ensure it all stays up to date to before the static initializer. Pick-to: 6.2 Change-Id: I801b678c01b4e4ddd4de16e9aead7167ec4477f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QElfParser: stop trying to look into the .rodata sectionThiago Macieira2021-09-141-3/+2
| | | | | | | | | | The return code NoQtSection was not being handled at all, so hasMetaData remained equal to false. This was probably not intended, but has been like that since Qt 5.0. See previous commit for details. Change-Id: I42eb903a916645db9900fffd16a4445eff9a082c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QPlugin: make the macros match the scanning code for ELF systemsThiago Macieira2021-09-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | For ELF platforms with a GCC-compatible compiler, the QElfParser has been ignoring the .rodata section ever since Qt 5.0 commit 7443895857fdaee132c8efc643e471f02b3d0fa4 ("Remove support for Qt 4 style plugins"). That change removed handling of return value QElfParser::NoQtSection from the ELF parser, which meant that the plugins without a .qtmetadata section were never considered plugins. In other words, for those systems, the __attribute__ macro is mandatory. For systems with a GCC-incompatible compiler, there were only two in Qt 5.x's lifetime: Oracle/Sun Solaris with SunCC and IBM AIX with IBM xlC compiler. Neither compiler supports C++17 according to [1], so they can't be in use in Qt 6. IBM xlC now comes with a Clang-based front-end for users who need Qt 6 and the OpenIndiana distribution of Open Source Solaris has been using GCC since 2012. So make the macros mandatory from now on. [1] https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B17_features Change-Id: I42eb903a916645db9900fffd16a443745446cc64 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QElfParser: remove one more unnecesary variable from the ELF parserThiago Macieira2021-09-142-3/+2
| | | | | | | | There's no need to keep this variable in the class. Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a35775d56d3e45 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QElfParser: don't attempt to parse ELF files of the wrong endiannessThiago Macieira2021-09-142-21/+12
| | | | | | | | | | | | | | There's no sense in continuing to parse. We'll never be able to load such a plugin anyway. This simplifies the code generation a lot because now all the read<T> calls become unconditional qFromUnaligned<T>, which is just a memcpy(), which for primitive types the compiler will simply emit a memory load into a register. Task-number: QTBUG-96327 Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a3574daf010635 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Q_DECLARE_INTERFACE: rework to use more inline functionsThiago Macieira2021-09-141-7/+19
| | | | | | | | | | That way, we can add the NOLINTNEXTLINE comment to suppress clang-tidy, which otherwise flags all usage of const_cast in C++ code. Change-Id: Ie72b0dd0fbe84d2caae0fffd16a247b96d223772 Reviewed-by: Rui Oliveira Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QDataStream: Add reminders to remove operators for qfloat16Ievgenii Meshcheriakov2021-09-141-0/+2
| | | | | | | | | | | | | Having I/O operators defined for incomplete types causes hard to diagnose problems when types with template conversion operators are used as arguments to signals or slots. Removing qfloat16 operators is not possible before Qt 7 because of backward compatibility. Task-number: QTBUG-93499 Change-Id: Ifa296bb58c45a06abf79dbe5666a666adaa8eab9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Adjust src/corelib/serialization/qdatastream.[h/cpp] for 6.3.0Shawn Rutledge2021-09-142-2/+4
| | | | | Change-Id: I9809d6122c6d3c5ad5753d52679f4ac67a17e3d4 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* macOS: Move handleMouseEvent: to MouseAPI categoryTor Arne Vestbø2021-09-141-53/+53
| | | | | | | Fixes warning of method definition not found. Change-Id: I87866785d1564e29fc356c033ae8cf972548ea7f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QByteDataBuffer::getChar() - assert that buffer is not emptyIvan Solovev2021-09-141-0/+2
| | | | | | | | | | | | | | | Found by CodeChecker. The getChar() method can return a garbage value if called on an empty buffer. Considering that QByteDataBuffer is an internal class and that there seems to be no current usage of this method, just add a Q_ASSERT to make sure that the buffer is not empty. Task-number: QTBUG-96303 Pick-to: 6.2 Change-Id: Iab0aee596aabafe999996f83177ca8bba16a58b6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QPlugin/QFactoryLoader: remove Qt 5 plugin remnantsThiago Macieira2021-09-141-3/+0
| | | | | | | | | | | Qt 6.x does not need to be able to read the old Qt 5-based binary JSON metadata. The QT_WARNING_DISABLE_DEPRECATED was needed in 5.15 while we used the then-deprecated functions to decode. Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a39ee074da3ef4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QPlugin: remove Q_EXTERN_C macroThiago Macieira2021-09-141-13/+4
| | | | | | | | | Our plugins are code generated by moc, so always C++. I don't know when the last time it was that you could declare plugins from C. Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a35e466f8a4c20 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QElfParser: don't use int for the enumThiago Macieira2021-09-133-4/+5
| | | | | | | | An enum shows the proper values in the debugger... Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a3a5848196983c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* feat: add new interfaces for std::filesystem::pathJiDe Zhang2021-09-142-3/+108
| | | | | | | | | Add for QFile::exists/symLinkTarget/remove/moveToTrash/ rename/link/copy Change-Id: I4cbb908e945f043b2a5278a6d8d5149b2f20e871 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Close QWidget during destruction via QWindowTor Arne Vestbø2021-09-131-1/+5
| | | | | | | | | Ensures that the QWindow and platform machinery is involved in closing the widget. Change-Id: I4ca4ed0b1b31b835d62d2fc0a2158e34e15d710e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPlatformWindow: fix isAncestorOf not breaking recursionRichard Moe Gustavsen2021-09-131-1/+1
| | | | | | | | | | | | The current implementation got stuck always asking for the parent of the same child This patch will make sure we actually walk up the parent chain. Pick-to: 6.2 6.2.0 6.1 5.15 Change-Id: I9f67f6305e0143526f53952a563d496e760ac2e7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't close popups in Cocoa plugin for most mouse eventsVolker Hilsheimer2021-09-133-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidget and QApplication handle popup closing for most events at the right time for the Qt-internal state logic. On other platforms popup QWindows are never closed automatically when clicking outside. So don't close any popups in the Cocoa plugin either, and let the Qt logic take care of it. This ensures that window activation is done at the right time, that Qt's modal popup stack is consistent, and that mouse replay for events closing a popup works. There are however two exceptions: mouse events in the window frame don't produce a QMouseEvent for Qt; and mouse events in a modally blocked (by Cocoa) window don't reach Qt at all. For those case, the logic in QWidget and QApplication is not enough. For the former, leave the change introduced in 70b94eea10d7af83cced092967 to explicitly close popups for LMB down in the frame. This still needs to happen before the event is delivered. For the latter case, deliver the event explicitly to Qt when we discover that the target window is modally blocked while a popup is active. The handleMouseEvent implementation then takes care of the redirect to the active popup, and Qt will further respect the modal stack in the QApplication::isWindowBlocked implementation. Change-Id: I578eb5e6aebc897a0ff1f69bc5c53bcaa05d138d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Don't hide QToolTip automatically when another window is closedTor Arne Vestbø2021-09-131-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTipLabel has a global application event filter, looking for reasons to close the tooltip. To fix QTBUG-55523 an additional condition was added in 7c18cb4f83c4907b40abc0bf40c1573b02243b57 to also close the tooltip when intercepting QEvent::Close, but this was unnecessary, as the fix in 29205c53e46fb2fc9f8063a46fd5ef5e9be532db was sufficient. Furthermore, hiding the tooltip on close events turned out to cause issues when the closing widget/window was the tooltip itself, causing recursion. This was fixed by 24239aef35f856c4c06428077e3428cbfdc51775. (which unintentionally also changed behavior for WindowActivate, WindowDeactivate, FocusIn, and FocusOut due to the case fallthrough). As it turns out, there is another case that will close the tooltip prematurely, and that's when the Qt::UI_AnimateTooltip effect is enabled, which is the case on e.g. Windows. In that situation a QRollEffect widget is created for the duration of the effect, which is then closed after the effect finishes. When closing the effect via QWidget close, we'll end up with a close event, triggering QTipLabel to hide itself. Since the logic of hiding the tooltip when other windows close was never needed to fix the original issue in QTBUG-55523, we opt to remove it completely, instead of adding even more heuristics to the code. Task-number: QTBUG-55523 Change-Id: I8d341262c85fd2e8cf9c496974e46ae0e9245e5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Expose the config and display for EGL-based QOpenGLContextsLaszlo Agocs2021-09-133-0/+17
| | | | | | | | | | | | | | | | ...in the native interface. Using OpenXR is impossible on some platforms (for example, Android) without knowing all three. The EGLContext alone is not enough, and EGL offers no way to query the EGLConfig a context was created with. https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_es_enable Therefore, expose all three so libs/apps can use the new way to query these native resource without resorting to the old-style nativeResourceFor* queries. Change-Id: I7efb0a26b858150da55e711752af99426e744322 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add documentation for QPropertyBindingErrorFabian Kosmale2021-09-131-11/+146
| | | | | | | Pick-to: 6.2 Change-Id: Ia957cedb4c80cbab956d93c5f1af4d3dd5209089 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTestJunitStreamer: Include <vector>Mårten Nordheim2021-09-131-0/+1
| | | | | | | | | The indirect include is not available everywhere Amends b8191f41c65a908d0529d235b0200e6de99c34fb Pick-to: 6.2 Change-Id: If0abf3b0186594ff5381dab847cbdf13e4fcf448 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: don't replay mouse presses that closed a popupVolker Hilsheimer2021-09-131-0/+2
| | | | | | | | | | | | | | On macOS, we only follow the native behavior to not replay mouse presses outside of a popup because we close popups in the QPA plugin before any popup-specific logic in QApplication kicks in, so a press that closed a popup is never seen by Qt at all. Before we can remove the popup closing code from the QPA plugin, implement the existing platform style hint for Cocoa to prevent mouse press replays. Change-Id: I2328f706ba148ece2d0e3fb4e71fe9123ab5e205 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Improve QAppleKeyMapper loggingTor Arne Vestbø2021-09-131-1/+14
| | | | | | Pick-to: 6.2 Change-Id: If0018f2a1c8809e66b695949e8dc7b463c4612a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't exclude WA_DontShowOnScreen widgets for QWidgetWindow event processingTor Arne Vestbø2021-09-131-8/+8
| | | | | | | | | | | | | | | | | | The Qt::WA_DontShowOnScreen widget attribute does not limit whether a widget will be created (have a QWindow and corresponding QPlatformWindow). It only limits whether the widget will be shown. As a result, we need to respect and process incoming events on a QWindow level, just as any other window. Any considerations that may apply because of WA_DontShowOnScreen should happen further down in the event delivery. For example for the issue in 74aae00a4e8e70845e8092abbefa7830c386e66b, where QWidgetWindow::handleExposeEvent() cleared the WA_Mapped flag which was set by QWidgetPrivate::show_sys(). Change-Id: I187ebe14ea84538a3715f1d09fb1ba1ce93fcc82 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Doc: Update some links to Microsoft's documentationLuca Di Sera2021-09-133-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation links on `msdn.microsoft.com` and `msdn2.microsoft.com` now redirect to `docs.microsoft.com`. Some of the links in the documentation were to those domains. In particular: - An `\externalpage` link to the `Mitigating Cross-site Scripting With HTTP-only Cookies` article. - An `\externalpage` link to `Microsoft Actibe Accessibility Event Constants` - A link to the `RtlGetVersion` function in `qoperatingsystemversion.cpp` - A link to the `GetCommandLine` function in `qcoreapplication.cpp` - A link to the `KNOWNFOLDERID` constant in `qfiledialog.cpp` While the redirection works, our script to catch broken links on dev-snapshots builds of the documentation doesn't handle redirection correctly, reporting it as broken. Both to appease the broken-links script and to avoid an unneccesary redirection, the above links were modified to point to the equivalent address in the new domain. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: I0e9a132f06af7fc43bca6c8ad2054feb6e3e27cd Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Update link to RFC-4627Luca Di Sera2021-09-131-1/+1
| | | | | | | | | | | | | | | | | | The old `tools.ietf.org/html/*` web pages containing RFCs now redirect to `datatracker.ietf.org/doc/html/*`. While the redirection work, our script to catch broken links on dev-snapshots builds of the documentation doesn't handle redirection correctly, reporting it as broken. Both to appease the broken-links script and to avoid an unneccesary redirection the RFC link in `json.doc` was modified to point to the new address. Task-number: QTBUG-96127 Pick-to: 6.2 Change-Id: Ic0b0441fb298cfe2e282904e7e8d9155ab25091c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix querying font aliases that share name with other fontsEskil Abrahamsen Blomfeldt2021-09-111-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a332f3fabc29f796526202648eddf35a24f1cb67 disabled resolving all fonts on the system for every font lookup, which was a significant startup time improvement. But it also caused a regression: When a font has an alias which shares the name of a proper font, then this would not be resolved correctly. This is fairly typical on Windows/GDI due to backwards-compatibility. Instead of being collected under a shared typographical family, fonts are disambiguated by adding the style name to the family name. The proper typographical name is still available, but this is not enumerated by the system. So "Segoe UI" for instance, will be available as "Segoe UI", "Segoe UI Light", "Segoe UI Bold" etc. When we populate family aliases, we register that "Segoe UI Light" is actually "Segoe UI" with Light weight, and prior to a332f3fabc29f796526202648eddf35a24f1cb67 this would be done implicitly. But after the optimization, we would only populate family aliases once we stumbled over a font request for a non-existent font. For "Segoe UI", we would simply return the regular weight font as the best imperfect match. The fix is to populate font family aliases not only when the family is non-existent, but when the match is imperfect, e.g. if we are asking for a Light weight font and only finding a regular one. User code can still avoid this somewhat expensive operation by using the full family names on Windows. This also requires a fix to a test. When removeApplicationFont() is called, we invalidate the font database, so it will be reset to a state that does not contain the family aliases. Therefore we cannot guarantee that it is identical to what it was before the test started, since this depends on what has happened previously in the application. [ChangeLog][QtGui][Text] Fixed an issue where some font styles and weights would not be selectable. This was especially noticeable on Windows. Pick-to: 5.15 6.1 6.2 Fixes: QTBUG-94835 Change-Id: I892855edd1c8e3d3734aace396f6000d897d2ec4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move QWINDOWSIZE_MAX to platform headersPaul Olav Tvete2021-09-102-2/+1
| | | | | | | | | | | QWINDOWSIZE_MAX is needed to implement platform plugins and Wayland shell integrations. Moving the #define from qwindow_p.h to qplatformwindow.h makes it available from a supported header file. This should not break anything, since qwindow_p.h includes qplatformwindow.h Change-Id: Ie003b1e9d6494695057d59aba5a17ad7fd51c654 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* testlib: Replace custom QTestCoreList with std::vectorTor Arne Vestbø2021-09-1010-209/+70
| | | | | | | | | | | | | | | | | The custom linked list implementation was implemented using recursion, and as a result didn't handle long lists of test cases, exhausting the stack on e.g. Windows where the default stack is only 1MB. This was the case with e.g. the tst_QChar test that produces 20K test cases. Replacing with a std::vector should do nicely for our use-case. No attempt has been made at further reducing the complexity of QTestElement/QTestCoreElement/QTestElementAttribute. Pick-to: 6.2 Change-Id: Ie295f7cf937ec6abdc4606b6120818551ad285c7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Allow destruction of QWinEventNotifier in its signalAlex Trotsenko2021-09-101-1/+3
| | | | | | | | | | | | Avoid use-after-free issue in QProcess. Fixes: QTBUG-96285 Fixes: QTBUG-96359 Pick-to: 6.2 6.1 Change-Id: I953d7a8ecaf301ec3a27db37e13748f905c3d097 Reviewed-by: Christoph Cullmann <cullmann@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Modernise and simplify handling of qtimezoneprivate_data_p.h's dataEdward Welbourne2021-09-102-120/+68
| | | | | | | | | | | | | | | | | Add some trivial inline methods to the classes that populate the tables to simplify access to their data. Use ranged-for loops to iterate those tables (now that they no longer have bogus all-zero entries at the end). In the process, noticed windowsIdToDefaultIanaId() doing a double iteration of the windowsDataTable, first via toWindowsIdKey() to map a windowsId to a key, then again to map that key to the matching ianaId; inline the former and use the table row from which it got the key to extract its ianaId instead. Change-Id: I76267f53c7e6f5c593e33b6146b8f98bfb6d042f Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove trailing zero rows from qtimezoneprivate_data_p.h's tablesEdward Welbourne2021-09-102-8/+4
| | | | | | | | | | They are not needed. Iterations over the table track their sizes. The size-of-table constants just needed their -1s removed. Incidentally use std::size() rather than sizeof(array)/sizeof(element). Change-Id: Ie20eef9f6f5786d93c10b830a87e006d3c5bcc1a Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use qmath.h's conversions between degrees and radiansEdward Welbourne2021-09-102-6/+6
| | | | | | | | The make the semantics overt and avoid the joys of yet another approximation to pi/180 hard-coded in our source-code. Change-Id: I9dcbaada2e7de119e385fc7056bc601ecd59311a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>