summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qnamespace.qdoc
Commit message (Collapse)AuthorAgeFilesLines
* QKeyCombination: use new comparison helper macrosTatiana Borisova2024-04-171-2/+4
| | | | | | | | | | Replace public friend operators operator==(), operator!=() of QKeyCombination to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE macro. Task-number: QTBUG-120304 Change-Id: I679f3fa5fcc4c675a763cc5a5fe0e0880439a64f Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Add AA_DontUsePopupWindowsOliver Eftevaag2024-04-051-0/+5
| | | | | | | | | | | | | | | | | | | We want QQuickPopup to open a top-level window in qt quick, by default. But also allow users to opt out, and revert back to the old behavior. It makes sense to have an application wide setting for this, in order to allow application developer to opt out of the new default behavior, without having to change a property for every instance of Popup. While QCoreApplicationPrivate::attribs bearly has any available bits, it appear that bit 30 is available, since AA_DisableWindowContextHelpButton was commented out. Task-number: QTBUG-121363 Change-Id: I6b2759d89b46aa5d08222c2611eaffe855cc425c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Documentation: Clarify palette/font/stylesheet inheritance/propagationAxel Spoerl2024-03-181-3/+3
| | | | | | | | | | | | | | | | Palette and font changes made by a style sheet are propagated to existing widgets and their children at change time. Palette and font changes made by setPalette() and setFont() are inherited by all existing and future children of the widget to which the call was made. Clarify this in the documentation. Fixes: QTBUG-122588 Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: Ic40d96fc1e5e4507f84a33138303b7193948d3fe Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add AA_DontUseNativeMenuWindowsMitch Curtis2024-03-151-0/+6
| | | | | | | | | | | | | | | Also add some categorized logging output to make it easier to check if native menus are being created. [ChangeLog][Qt Core] Added AA_DontUseNativeMenuWindows application attribute. Menu popup windows (e.g. context menus, combo box menus, and non-native menubar menus) created while this attribute is set to true will not be represented as native top level windows, unless required by the implementation. Task-number: QTBUG-69558 Change-Id: Iba11b89c67d942ce6c5a28a7c57a86e63c020618 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: fix warning "class Qt::TimerId' specified with '\enum'"Thiago Macieira2024-03-061-1/+1
| | | | | | | Amends 4bc0834bc182335984431c6a1525782efc34368c. Change-Id: I6818d78a57394e37857bfffd17ba0f3897b2a5f5 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Timers: add Qt::TimerId enum classAhmad Samir2024-03-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Which will be used to represent timer IDs. Thanks to Marc for the idea to use "a strongly typed int". QTimer got a new id() method that returns Qt::TimerId (can't overload timerId()). Various classes in qtbase have a member named timerId(), but a new method is needed anyway in QTimer so id() it is (this is the reason QChronoTimer only has id() and no timerId()). Besides timer.timerId() has an extra "timer". This commit fixes the inconsistency between QObject using `0` timer id to indicate "failed to start", while QTimer::timerId() returned `-1` to indicate "timer is inactive". QTimer::id(), being a new method and all, now returns Qt::TimerId::Invalid, which has value `0`, so that the values match between the two classes. Extend the unittests to ensure QTimer::timerId()'s behavior is preserved. [ChangeLog][Core][QObject] Added Qt::TimerId enum class, that is used to represent timer IDs. Change-Id: I0e8564c1461884106d8a797cc980a669035d480a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update the default behavior of items with layoutSanthosh Kumar2024-03-011-4/+12
| | | | | | | | | | | | | | | | The earlier patch 4ae537e67c99160f5dcac99f40d03a7921456556 had default behavior as opt-out for size policy of items within the layout. This can cause a lot more UI regressions than anticipated and, so make it as opt-in (Qt::AA_QtQuickUseDefaultSizePolicy). This means that the user needs to explicitly set this attribute to utilize the default size policy of quick items. Amends patch 4ae537e67c99160f5dcac99f40d03a7921456556 Task-number: QTBUG-117597 Pick-to: 6.7 Change-Id: Ibdb3ea9897c19792a110cbb15834b27383b9103e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add Qt::AA_QtQuickDontUseDefaultSizePolicyJan Arve Sæther2024-01-081-0/+5
| | | | | | | | | | | This flag should be set in order to opt out of that Qt Quick Layouts takes implicit (built-in) size policies into account, a feature that was introduced in Qt 6.7 Task-number: QTBUG-117597 Pick-to: 6.7 Change-Id: I206cd61534b2103b2c3a9b4abc97fec8c88799d1 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Doc: Remove references to Qt 4 in Qt 5.0 in Qt Core documentationKai Köhne2023-12-181-3/+2
| | | | | | | Pick-to: 6.6 6.7 Change-Id: Ide0c1ed441c923753f1e81141460719161662c15 Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Doc: Fix warnings and linking issuesTopi Reinio2023-10-091-2/+1
| | | | | | | | | | | | | | | | | | | | Remove or replace links to examples that were removed or moved under manual tests. Replace code snippets that were quoting the now-missing examples. Fix documentation of QSet::removeIf(). Fix typo in documentation macro: Unknown command '\examplecateogry'. Add qtopengl, qtshadertools dependencies to Qt Widgets documentation project to enable correct linking to those topics. Mark all documentation sets in qtbase as free of warnings. Pick-to: 6.6 6.5 Change-Id: I058cd5f2063aa933ea310bceff906f05422a7cb2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Rename Qt::Key_mu to Qt::Key_microEdward Welbourne2023-08-241-1/+4
| | | | | | | | | | | | | | | | | The old name misleadingly identifies it as the Greek letter on which it is based (and to which it case-folds); but U+00B5 is MICRO SIGN, not the Greek letter mu, and pretending it is the latter only leads to confusion. Retain the old name as an alias to the new, prepare to deprecate it from 6.11 and change all uses of it to the new name. [ChangeLog][QtCore][Qt::Key] Qt::Key_mu is now renamed Key_micro, since it is, in fact, the micro sign, not the Greek letter mu. The old name is retained as an alias for the time being. Change-Id: I4deb905f5e59b906710bd092c05a2c0a9b6bba65 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* doc: Make docs for ElideNone a bit more preciseEskil Abrahamsen Blomfeldt2023-08-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | ElideNone was originally introduced as a way of modifying behavior of specific widgets, such as QTabBar. The text would previously always be a elided and an ellipsis character would be added somewhere to indicate this to the user. Given that context, it makes sense that the documentation says the effect of ElideNone is that ellipsis does not appear in the text, since the text would still be elided if it were too long, given that the painter would draw it clipped to the widget. When QFontMetrics::elidedText() was introduced later, this became more confusing. In the context of this function, you would expect the text to be returned truncated to the width but without the ellipsis character. Instead it just returns the full string. Since this has been the effect of ElideNone since the start and multiple places use it as a way of disabling the truncation of the string, we simply update the documentation to make this more clear. Pick-to: 5.15 6.2 6.5 6.6 Fixes: QTBUG-40315 Change-Id: If037430da6260020b1d99be7bd43e622f8afa844 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Align QKeySequence behavior between macOS and iOSTor Arne Vestbø2023-06-081-3/+3
| | | | | | | | | | | | | | | | | | External keyboards for iOS/iPad devices have the same Macintosh based keyboard as Macs have, with Command (or Cmd) ⌘; Option (or Alt) ⌥; and Control (or Ctrl) ⌃ keys. We were already declaring the QPlatformTheme::KeyboardScheme as MacKeyboardScheme on iOS. [ChangeLog][iOS] Keyboard shortcuts now follow the same scheme as on macOS, with their native representation expressed via the ⌘, ⌥, and ⌃ modifiers. Use Qt::AA_MacDontSwapCtrlAndMeta to override this. Pick-to: 6.6 Fixes: QTBUG-113165 Change-Id: Ia1856ee1718dab9f2f2512ffffc8b4d3cc5adecc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename Qt::Appearance to Qt::ColorSchemeTor Arne Vestbø2023-02-131-1/+1
| | | | | | | | | | | | Based on discussions in the 6.5 API review, where we concluded that 'appearance' is too general. Instead, we follow the CSS standard and use the term 'color scheme'. Pick-to: 6.5 Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Reflect QStyleHints in AA_DontShowShortcutsInContextMenusTor Arne Vestbø2023-01-041-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | There are two ways to override whether shortcuts (key sequences) should be shown in menus, QStyleHints::::showShortcutsInContextMenus() and the Qt::AA_DontShowShortcutsInContextMenus application attribute, but only the latter is checked by our own menu implementations. This was confusing, as overriding the style hint had no effect. It makes sense for the QStyleHint to be based on the platform style hint, but since we also allows overriding it, the logic in QGuiApp that initializes Qt::AA_DontShowShortcutsInContextMenus should be based on the QStyleHint. Note that the inverse relationship is not maintained, as the app attribute should not affect the style hints. This creates a somewhat awkward situation in terms of when you need to override the behavior, so we might consider deprecating one of the options. Fixes: QTBUG-109590 Task-number: QTBUG-69452 Change-Id: I366c17ff00fd8ae10553bbfb88d162ffd2c8040f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Adapt QTimeZone to handle Qt::TimeSpec machineryEdward Welbourne2022-12-091-1/+11
| | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QTimeZone] QTimeZone is now always defined; feature timezone now controls most of its prior API and some new API is added, most of it always present, to enable QTimeZone to package a Qt::TimeSpec and, for Qt::OffsetFromUTC, its offset. Prior to this change, APIs using Qt::TimeSpec had to provide a separate function taking a QTimeZone alongside a function taking a Qt::TimeSpec and optional offset; it will now be possible to unify these into a single function taking a QTimeZone. Adaptation of other Qt classes to do so shall follow. Task-number: QTBUG-108199 Change-Id: If5ec3cc63920af882ebb333bf69cde266b1f6ad7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Plumb public permission APIs to Android backendTor Arne Vestbø2022-11-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | The lock and unlock of the Android deadlock mutex is now part of the internal implementation instead of limited to the enum based permission API. It is unclear why 8bca441b6f65 added the guard only to this API and not to the string based API as well. The check for isBackgroundLocationApi29 has been removed, as the logic seemingly resulted in accepting every single permission type except location permissions if used via the enum-based API. Since Android's platform permission API doesn't have an Undetermined status, we keep a hash of the status for each permission type, and by default checkPermission() would return Undetermined, until a requestPermission() call is done which updates the internal hash, and after that checkPermission() would return properly Granted/Denied. Task-number: QTBUG-100413 Change-Id: Ia95c76af754481a281bc90198e349966c9c2da52 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Long live QPermissions!Tor Arne Vestbø2022-11-011-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many features of today's devices and operating systems can have significant privacy, security, and performance implications if misused. It's therefore increasingly common for platforms to require explicit consent from the user before accessing these features. The Qt permission APIs allow the application to check or request permission for such features in a cross platform manner. The check is always synchronous, and can be used in both library and application code, from any thread. The request is asynchronous, and should be initiated from application code on the main thread. The result of the request can be delivered to lambdas, standalone functions, or regular member functions such as slots, with an optional context parameter to manage the lifetime of the request. Individual permissions are distinct types, not enum values, and can be added and extended at a later point. Task-number: QTBUG-90498 Done-with: Timur Pocheptsov <timur.pocheptsov@qt.io> Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Change-Id: I821380bbe56bbc0178cb43e6cabbc99fdbd1235e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Clarify that FramelessWindowHint does not guarantee fixed sized windowsTor Arne Vestbø2022-09-201-2/+8
| | | | | | | | | | | | | | Depending on the window manager or operating system the act of making a window borderless may also affect the ability for the user to move or resize a window interactively. However, this is a side effect of making a window borderless, and should not be relied on. The correct way to ensure a window has a fixed size it to use setMinimum/MaximumSize. Fixes: QTBUG-103503 Fixes: QTBUG-106710 Pick-to: 6.4 Change-Id: I6d82380f5a9af1f08b12cb445792ecbf71bb0377 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add enum class Qt::AppearanceAxel Spoerl2022-09-161-0/+11
| | | | | | | | | | | | It has been decided to add an appearance property in QStyleHints, which will be propagated to classes that do not include QPlatformTheme. Therefore an appearance enum class is added to the Qt namespace, thus being available to all Qt classes. Task-number: QTBUG-106383 Change-Id: Icff94b0d7adca954ce74241d6811401d41f053e6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Long live QT6_{DECL,IMPL,CALL}_NEW_OVERLOAD!Marc Mutz2022-07-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have in the past found ourselves in need of disambiguating new overloads from older, QT_REMOVED_SINCE'ed ones, which we usually did by adding a defaulted int argument, cf. e.g. QMetaType::id(). The problem with a defaulted int argument is twofold: First, an int is a valid argument type, and users may get confused as to its meaning when presented with the signature in the IDEs auto-completion popup, and a lot of things implicitly convert to an int, so any errornous parameter passing may stay unnoticed until we remove these fake arguments come Qt 7. Second, this way of doing things requires a lot of ifdef'ery to keep the additional argument out of both the docs and future Qt 7 builds. The solution presented in this patch is to create a tag type, QDisambiguated_t, which a) more clearly communicates its purpose and b) doesn't implicitly convert from anything. To help with the invariably ugly ifdef'ery, provide a set of macros that hide this stuff from qdoc and Qt 7 builds. Use the macros to replace the fake int arguments that were added for 6.4. Pick-to: 6.4 Change-Id: I6916f38c8eb9793ad6dea5f61e7e5fff7e75e273 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Windows QPA: Add MSWindowsNoRedirectionBitmap flag"Tor Arne Vestbø2022-07-141-8/+0
| | | | | | | | | | | | This reverts commit 417bb463526d3ec3d80d66b029c1064fde88391f. The API addition was premature, as it can potentially be handled by the platform plugin automatically, and if not, should possibly live in QSurfaceFormat instead. Change-Id: I5c7050ce9c50b6c6a93ddfa6d2e842db0b9eed0d Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Windows QPA: Add MSWindowsNoRedirectionBitmap flagYuhang Zhao2022-07-141-0/+8
| | | | | | | | | | | | This flag will be useful for windows that only use 3D graphics API to do the rendering, such as Qt Quick applications. As a drive-by, fix a typo in the above line. Pick-to: 6.4 Change-Id: Ic6edcb7610055693734a5d5aff5e906991d4b911 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Convert Since ... comments on \value lines to [since ...] parametersEdward Welbourne2022-05-311-4/+4
| | | | | | | | The \value command supports a [since ...] parameter. We might as well use it, to standardize how we document when enum members were added. Change-Id: I68a101e8101f780d0e6607a63723aa1bd837bb56 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Update documentation of enum Qt::DockWidgetAreaAxel Spoerl2022-04-191-6/+10
| | | | | | | | | Describe enum usage in QDockWidget::isAreaAllowed() as well as meaning of enum members. Pick-to: 6.3 6.2 5.15 Change-Id: Ib88509feb001be27c11fd167c9009da50ce1b851 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deduplicate lastWindowClosed handlingTor Arne Vestbø2021-10-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Whenever a window was closed, we had logic to check if it was the last window, and if so emitted lastWindowClosed and then tried to quit the application. But the automatic quit process also checked if there were any remaining windows, as this process could be triggered as a result of a QEventLoopLocker going out of scope. The two paths now share the same logic for determining if there are any remaining windows. The docs have been updated to reflect the original intent of the logic, dealing only with primary windows (top levels without a transient parent). This was how both the original code paths implemented their logic. For historical reasons the Qt::WA_QuitOnClose attribute is closely tied to the lastWindowClosed signal, and isn't merely limited to controlling whether we try an automatic quit when the last window closes. For now this behavior has been kept, but the docs have been updated to clarify how the attribute is handled in practice. Change-Id: If3d06b065236aad2e59e9091cac3146bc4cf79f6 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix reference to quitOnLastWindowClosed in WA_QuitOnClose docsTor Arne Vestbø2021-10-041-1/+1
| | | | | | | | The property is nowadays on QGuiApplication. Pick-to: 6.2 Change-Id: I8759761b08b0cdcef786ca96a7fa6364331f157d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add note about ImCursorPosition/ImAbsolutePosition not including preeditTor Arne Vestbø2021-08-211-2/+5
| | | | | | | | | | | | The cursor position as reflected by these two properties is not affected by the offset of the cursor in the preedit area. That means that when composing text, the cursor position stays the same, at the preedit insertion point, regardless of where the cursor is positioned within the preedit string by the QInputMethodEvent::Cursor attribute. Pick-to: 6.2 Change-Id: Ic2584369f92271e3f242d51f2e647f6f05c72d53 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QNativeGestureEvent::deltas() to delta(); clarify docsShawn Rutledge2021-07-141-4/+3
| | | | | | | | | | | | | | | | | In QPanGesture this is called delta(). OTOH we have QWheelEvent::pixelDeltas(). Delta is a vector, and there's only one (with two components). Native gestures hold incremental values: e.g. the pinch gesture event provides an incremental amount of either zooming or rotation (so most events have QNativeGestureEvent::value() very close to 0). It's the same with the pan gesture's delta(). Add better docs for swipe and pan gestures. Change-Id: Ia147c7c9a22e084c3700b1620dec46427d792bd1 Reviewed-by: Povilas Kanapickas <povilas@radix.lt> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Add note to Qt::MatchFlags about implementation dependent behaviorPaul Wicking2021-06-211-0/+5
| | | | | | | Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94374 Change-Id: I7f426c92bf0434998d0793eedd405c1a682a28d9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Document that WA_TranslucentBackground will not have an effectLaszlo Agocs2021-06-141-3/+6
| | | | | | | | | | | | ...if changed after the widget is shown. Just documents the current state of things. Task-number: QTBUG-60822 Task-number: QTBUG-59126 Pick-to: 6.2 6.1 Change-Id: If8281dce4457707a1673aca7a50744d8b231b030 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: allow Qt::AA_DontShowShortcutsInContextMenus overridesVolker Hilsheimer2021-06-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Following the discussion in QTBUG-69452, the resulting change in cc33dd079796437bafed8f42de7fbf8f17d19ec8, and the documentation of QAction::shortcutVisibleInContextMenu, the intention is that the attribute allows the overriding of the platform default. However, QAction did ask both the attribute and the platform integration, making the override impossible. Instead, ask only the attribute, but default the value of the attribute to what the platform integration provides. [ChangeLog][QtGui][QAction] The shortcutVisibleInContextMenu property defaults to the value of the Qt::AA_DontShowShortcutsInContextMenus attribute, which in turn defaults to the platform integration. To override the default, set the application attribute after instantiating QApplication, or override the default for each QAction instance. Task-number: QTBUG-73990 Pick-to: 5.15 6.1 Change-Id: Iaba330913555d93d05efe1b3965a6aea39db5554 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-3/+3
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QAbstractItemModel::match: code tidiesGiuseppe D'Angelo2021-05-121-0/+1
| | | | | | | | Remove a magic number from the code, by adding it (as a private value) to the right enumeration. Use toInt() to convert to integer. Change-Id: Id1b00dde900619684b5a3df247d46938439150ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Document new InputMethodQuery enum valueVolker Hilsheimer2021-04-131-0/+1
| | | | | | | | | This amends c80f262258b7846bf199887bcfdbb6dcfda6ad6f. Change-Id: Iec8a8f5ce50fdf0ba371a287f243186b2435e594 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Prepare TextDate to use UTC-offset rather than GMT-offset zone suffixesEdward Welbourne2021-02-151-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are GMT-offset zones whose convention for the sign of the offset is the reverse of what we are (still) using, which is the usual convention for UTC-offset zone: for example, the Olson Database's Etc/GMT+3 has offset -3 hours in the UTC-based system we use, so we give it suffix GMT-0300. The UTC-based suffix is also what we use as the abbreviation for OffsetFromUTC() in toString(). For now this only adds support for parsing a planned future form: the old form using GMT is retained, to give client code some chance to prepare for a backwards-compatible transition. Although the GMT prefix is matched case-insensitively, only match UTC if fully upper-case; there is no meaningful precedent for case-insensitive usage here. [ChangeLog][QtCore][QDateTime] The Qt::TextDate format now recognizes UTC-based offset suffixes in addition to suffixes based on the deprecated alias GMT. This prepares for toString() to use such UTC-based suffixes for time-zones (fromString() cannot parse the present abbreviation suffix). A future release of Qt shall use UTC-based suffixes in place of the present GMT-based suffixes (which conflict with GMT-based IANA zone names) for Qt::LocalTime and Qt::OffsetFromUTC time-specs. Client code is encouraged to use and recognize UTC-based zone suffixes in preparation for that transition, unless compatibility with versions before 6.2 is required. Change-Id: I5a42a488f1232a30f4b427b7954759283423b9b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systemsEdward Welbourne2021-02-121-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test verified that a LocalTime's time since Epoch changes when the system time-zone changes. This works when the QDateTime object is in short form and recomputes its offset from UTC every time it is needed, but fails with a pimpled QDateTime, as this caches its offset from UTC when it is created, saving the recomputation which - in the far more usual case where the system time-zone does not change in the lifetime of a QDateTime object - would normally produce the same result. Changed the test to use a newly-created QDateTime constructed with the same parameters, which doesn't have the cached out-of-date knowledge of its zone offset. Removed the XFAIL. Made the test data-driven and added test-cases: one so close to the Epoch that it should be short even on 32-bit systems, one so far that it's pimpled even on 64-bit systems (used in reproducing the issue in order to debug it). This then revealed that Android 5 doesn't seem to support the POSIX zone IDs used by this test, so it now verifies that LocalTime has the expected offset from UTC after zone changes, QSKIP()ping if not. Documented that the behavior of LocalTime is undefined after a change to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec in the process. Fixes: QTBUG-89889 Pick-to: 6.1 6.0 5.15 Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-151-19/+19
| | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Pick-to: 6.0 Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* macos: Document that Drawer is obsoleteMorten Johan Sørvig2020-12-211-0/+2
| | | | | | | | | | This feature is not much used on modern macOS, and Qt 5 has never supported it. Pick-to: 5.15 6.0 Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update setHighDpiScaleFactorRoundingPolicy docsTor Arne Vestbø2020-11-271-2/+1
| | | | | | | | | | | The default is now passthrough. And let's not mention the environment variable overrides, as they are meant for internal testing. Pick-to: 6.0 Pick-to: 6.0.0 Change-Id: Ie2409e5411d4bdcdf041834cb5ca9e1215aa173a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Expunge WA_GroupLeaderShawn Rutledge2020-10-271-3/+0
| | | | | | | | | It's been deprecated since Qt 4.1. Task-number: QTBUG-85816 Change-Id: Iafc6340716556f54fc5472c60035bb57461b842f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix documentation for hidden friend operatorsVolker Hilsheimer2020-10-231-4/+2
| | | | | | | | At least for qdoc, hidden friends are class members. Change-Id: I6eaa21565937cd49c0905ee47b8b82b0c1765bc1 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Purge QDesktopWidgetVolker Hilsheimer2020-10-161-2/+1
| | | | | | | | | | | | It's no longer used; the only calls to QApplicationPrivate::desktop pass the default nullptr for QScreen, so all we need is a Qt::Desktop type toplevel widget. Include changes documentation about both the class and QApplication::desktop being gone in Qt 6. Change-Id: I22d6e93cabc6aaaefffe5e96942886a2ef4e0609 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Allow millisecond-overflow when the result remains validEdward Welbourne2020-10-071-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even before adding support for fractional hours, a fraction of a minute might potentially have represented a whole number of seconds by a fractional part that, due to rounding, was less than the whole number of seconds by less than half a millisecond. Previously, the parsing would have clipped the fractional part at 999 milliseconds, in the preceding second, instead of correctly rounding it up to the whole second. For QTime::fromString(), which can't represent 24:00, and for TextDate, which doesn't allow 24:00 as a synomym for the next day's 0:0, applying such rounding to 23:59:59.999999 would produce an invalid result from a string that does represent a valid time, so use the nearest representable time, as previously. Added some tests and amended others. [ChangeLog][QtCore][QDateTime] QDateTime and QTime, in fromString() with format ISODate or TextDate, now allow a fractional part of the hour, minute or seconds to round up to the next second (hence potentially into the next minute, etc.) when this is the closest representable value to the exact fractional part given. When rounding up would turn a valid result into an invalid one, however, the old behavior of clipping to 999 milliseconds is retained. Change-Id: I8104848d246cdb4545a12819fb4b6755da2b1372 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Use start of day when wrapping 24:00 to the next dayEdward Welbourne2020-10-071-16/+17
| | | | | | | | | | | | | | | Previously we used 0:0 on the next day, which might fall in a fall-back's gap. [ChangeLog][QtCore][QDateTime] When fromString() reads 24:00 in ISO format, it now uses the start of the next day, rather than 0:0 on the next day. This only makes a difference if the next day's first hour is skipped by a time-zone transition. Change-Id: Ib81feca5dc09fa735321b6ab76d5d118d6db6fd2 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: Remove WA_MacVariableSize widget attributeTor Arne Vestbø2020-10-061-4/+0
| | | | | | | | It was used for the deprecated HI-based theming, removed in 50428e97270ad7c87439af599dce33b697c8cc44. Change-Id: Ic0c216c2c056de81c85bcb1e724c0b8ecb8ac7ec Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Remove dead widget attribute WA_MacNoShadowTor Arne Vestbø2020-10-061-1/+0
| | | | | Change-Id: If17acc230fc7669e46956ac2150a5a395694666c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Handle trailing cruft consistently in Qt::DateFormat parsingEdward Welbourne2020-10-031-28/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the ISO time format would tolerate trailing cruft at the end in various cases even though there might be an offset specifier after the time, which should *not* be separated from it by anything (not even the spaces we originally planned to still tolerate). The RFC date format is forgiving about space, as is suitable for parsing of RFC-822 headers, but the other formats should match the handling in QDateTimeParser, which rejects any dangling cruft. At the same time, since this required a re-write of fromIsoTimeString() in any case, add support for the ISO format that gives the hour a fractional part and skips minutes and seconds. Previously we only had support for fractional minutes (with no seconds). The hour without even a fractional part is also valid. Reworked the documentation of Qt::DateFormat as it was wrong in places, inconsistent in its formatting and incomplete. Adjusted some tests to match the new behavior. A fraction separator with no following digits should have been recognized as an error previously and now is. [ChangeLog][QtCore][QDateTime] The ISODate and ISODateWithMs formats now reject trailing cruft (including spaces) at the end of a time string. They also gain support for parsing hour-only formats, including the hour-with-fractional-part format. Task-number: QTBUG-86133 Change-Id: I38ad1479ae033407f7df97ffbeb7c4bcd463d04a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc warning from undocumented enum valueVolker Hilsheimer2020-09-251-0/+1
| | | | | Change-Id: Ie6ea916388867cc705a87544e893e55f715e83d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>