summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Decouple QApplication from QColormapTor Arne Vestbø2025-06-061-3/+0
| | | | | | | | | | | | | Initialize the shared QColormapPrivate on first call to QColormap::instance, in a thread safe manner for good measure, and clean it up on app exit if needed. The cleanup now also accounts for the possibility of QColormap instances outliving the cleanup. We still reset to a new QColormap on next use, following the existing behavior. Change-Id: Ia16a84994b3ee05f9431ba24dd9126f2dc271b61 Reviewed-by: Paul Olav Tvete <[email protected]>
* Decouple QApplication::isEffectEnabled from QColormapTor Arne Vestbø2025-06-031-1/+3
| | | | | | Change-Id: I26468cc528d2c516492db11ca4109e6be63c1b5a Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Paul Olav Tvete <[email protected]>
* Doc: Fix auto-links to deprecated functionsDavid Boddie2025-05-311-2/+1
| | | | | Change-Id: Id4456eef3440734add2d804d186966e253335b7c Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Widgets/Stylesheets: compile without FEATURE_style_stylesheetChristian Ehrlicher2025-05-011-0/+2
| | | | | | | | | | | Make sure to not compile the stylesheet sources when FEATURE_style_stylesheet is disabled, also don't include the relevant headers in this case. Pick-to: 6.9 Fixes: QTBUG-136341 Change-Id: I4fc2de2fcba004b93140809ef79374401209f14a Reviewed-by: Axel Spoerl <[email protected]>
* Widgets/Stylesheets: Remove double negations for stylehseet featureChristian Ehrlicher2025-05-011-7/+7
| | | | | | | | | | Replace ifndef QT_NO_STYLE_STYLESHEET antipattern by if QT_CONFIG(style_stylesheet). Pick-to: 6.9 Task-number: QTBUG-136341 Change-Id: I8f5d5ff0b7b5cce010df167977214bc92a9443b7 Reviewed-by: Axel Spoerl <[email protected]>
* Cast NativeResourceForIntegrationFunction via QFunctionPointerTor Arne Vestbø2025-03-271-4/+4
| | | | | | | | | | | | To fix warnings with Xcode 16.3: /Users/torarne/dev/qt/qtbase/src/widgets/widgets/qtabbar.cpp:117:6: warning: cast from 'QPlatformNativeInterface::NativeResourceForIntegrationFunction' (aka 'void *(*)()') to 'SetContentBorderAreaEnabledFunction' (aka 'void (*)(QWindow *, unsigned long long, bool)') converts to incompatible function type [-Wcast-function-type-mismatch] 117 | (reinterpret_cast<SetContentBorderAreaEnabledFunction>(function))(q->window()->windowHandle(), identifier, q->isVisible()); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Pick-to: 6.9 6.8 Change-Id: Ie7b5ace64c1aad5f970bc1a23e59c5724fcd92b5 Reviewed-by: Marc Mutz <[email protected]>
* Doc: Improve deprecation description for QApplication::fontMetrics()Andreas Eliasson2025-02-141-3/+7
| | | | | | | | | | | | Add a link to QFontMetrics, which provides more information about the differences between QFontMetrics and QFontMetricsF and why the latter is the preferred choice. Fixes: QTBUG-127528 Pick-to: 6.9 6.8 6.5 6.2 Change-Id: Ib5713a9d39bf312a6eae6b8b1a6d1dc1d47e25be Reviewed-by: Marcus Tillmanns <[email protected]> Reviewed-by: Christian Ehrlicher <[email protected]>
* Replace all QPair/qMakePair with std::pair in qtbase/widgetsIsak Fyksen2025-01-091-2/+2
| | | | | | | | | | As a drive-by replace QList::append and operator<< with emplace_back, to avoid repeating value_type. Task-number: QTBUG-115841 Pick-to: 6.9 6.8 Change-Id: I6fb790f959b41b0feb49e3a0f0b6b3631e24a232 Reviewed-by: Marc Mutz <[email protected]>
* QApplication: don't create app_fonts() on destructionThiago Macieira2025-01-081-1/+2
| | | | | | | | | Minor optimization, will probably never be needed. Change-Id: I14568dffcb5d09668753fffd24efd10a3fedb21b Reviewed-by: Marc Mutz <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Ahmad Samir <[email protected]>
* Replace qgetenv() calls converted to QString with qEnvironmentVariable()Thiago Macieira2025-01-011-4/+4
| | | | | | | | It's slightly more efficient. Pick-to: 6.9 Change-Id: Id5ac04fc27eee108c8e5fffd786c3d5f793a0a9d Reviewed-by: Ahmad Samir <[email protected]>
* Q*Application: move the compressEvent() virtual to the Private classThiago Macieira2024-12-131-1/+8
| | | | | | | | | | | | | | | | | | One of the parameters is the QPostEventList, which is declared in qthread_p.h: class QPostEventList : public QList<QPostEvent> and is thus private API anyway. This also requires the ELFVERSION: token in qthread_p.h to avoid marking every class derived from Q*Application as needing private Qt ABI. We can't remove the virtual in Qt 6, so we keep the fallback implementations to just forward to the Private::compressEvent() call. I've elected to mark the QApplication's override as final. Change-Id: I49a46f42e62bcaf7db69fffd12a664d8720bbe46 Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* QCoreApplication: replace threadRequiresCoreApplication()Thiago Macieira2024-11-261-2/+3
| | | | | | | | | | | | | | | | | With a direct access to the threadData's variable. Amends commit 10c529b08de7cd55b4c3e3654464119246498273 ("Add a way for auxiliary threads to handle events without CoreApp", Qt 5.6), which introduced QDaemonThread, for QtDBus use. We don't need to get the QThreadData from TLS, because we are processing events for an object associated with that particular thread. This removes the only use of QThreadData::current(false) in all of Qt. Refactoring in the next commit(s). Change-Id: Ica2bab556bd431519a1bfffd859911ea7daf062f Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ahmad Samir <[email protected]>
* Fix ubsan warning of illegal cast and illegal method callAllan Sandfeld Jensen2024-11-131-4/+4
| | | | | | | | | Avoid casting an event to a type it does not have. Instead use a static accessor class. Pick-to: 6.8 Task-number: QTBUG-99563 Change-Id: Ideb11779b1510cd10a27fb8bc40bcc8e4849bf15 Reviewed-by: Marc Mutz <[email protected]>
* Restore event replay when a popup is closed by mouse press outsideShawn Rutledge2024-11-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a popup (such as a context menu or combobox) is open, and the user presses any mouse button outside the popup, Windows users expect the mouse event to be sent to whatever is under the mouse, while the popup closes. (So the popup must close on press, not on release.) QPlatformIntegration::ReplayMousePressOutsidePopup requests this platform-specific behavior in general, and the WA_NoMouseReplay attribute can disable it on specific widgets. e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9 removed this feature which was added to Qt 5 in 1f456b4cbb93e3fea699878d117900b703146213, based on doubt that we really needed it: and if we did, maybe we would need it in QtGui. But so far it seems the main excuse for doing it this way is that popups are sometimes opened with exec(). If the nested event loop handles the mouse press completely, and the QPA event is discarded, the outer loop has no chance of seeing it after exec() finishes. In Qt Quick, we don't use exec(); so let's assume that this continues to be needed only for widgets. At least we don't use extern sharing of a global bool in this version. Fixes: QTBUG-130138 Pick-to: 6.8 Change-Id: I95b5d24ee9bc8608655ed5c585d1d91a891fbad3 Reviewed-by: Volker Hilsheimer <[email protected]>
* QWidgetWindow: fix enter/leave events not sent due to fractional scalingDavid Faure2024-08-301-2/+2
| | | | | | | | | | | | | | | | If widget A starts at y=0 and widget B starts at y=19, when the mouse moves from y=15 to y=18.6667, the code was doing childAt(p) with a rounded QPoint y=19 and finding B, but then the relative coord for B was set to -0.33333 so B wasn't under the mouse and didn't get an enter event (and since it's now the "last receiver", it doesn't get one later either when y is bigger). Add QWidget::childAt(QPointF) to fix this. Fixes: QTBUG-128391 Pick-to: 6.8 Change-Id: I76d4b711a8297648780bdd079eb67405ab12be14 Reviewed-by: Volker Hilsheimer <[email protected]>
* Straighten out various logging categoriesUlf Hermann2024-06-191-1/+1
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: I6f3b596ed4f0adc9873dd0a5f54f055a991a6207 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Move popup management from QApplication to QGuiApplicationShawn Rutledge2024-05-311-58/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to be able to have true popup windows in Qt Quick and Controls, including handling the press-drag-release sequence to select one entry from a menu or combobox. After the mouse press, a new window is created. On some platforms (such as xcb), the new window gets window system grabs of both keyboard and mouse (QApplicationPrivate::openPopup() calls grabForPopup() and it actually works); while on others, the pre-existing window continues to get the whole sequence of mouse events until the release. In the latter case, Qt needs to forward events from the original window to the popup. Until now, the list of popups was QApplicationPrivate::popupWidgets. Now we track the open popups as a list of QWindows rather than QWidgets, in QGuiApplicationPrivate::popup_list, and add a set of static functions to manage that list. Functions such as QApplication::activePopupWidget() QApplicationPrivate::openPopup() and closePopup() are rewritten to make requests to QGuiApplicationPrivate. 276943c8b791ba5897dcdb1ecfda780ac33a090b made QGuiApplicationPrivate::closeAllPopups() virtual. That is now reverted, because we're putting QGuiApplication in charge of popup management and trying to minimize widget-specific behavior. So far, QApplicationPrivate::closePopup() is still overridden to take care of focus changes. So far, QtGui does not take care of closing popups when the user clicks outside: the active popup window gets those events, and needs to close itself if the click occurs outside. An attempt to move this logic raised some issues with legacy widget test cases. Using a touchscreen to press on QMenuBar and open a QMenu, drag to a menu item and release, is temporarily broken for now. The plan is to fix it in a subsequent patch. Task-number: QTBUG-68080 Task-number: QTBUG-69777 Change-Id: I02b5034987b5ee8909917d305f414c8b0db9c7f5 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* Windows 11 style: simplify code to polish paletteVolker Hilsheimer2024-05-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cases in which we let the style polish a palette: - after merging the system palette and the style's standard palette - or when a widget-class specific palette gets set A style needs to know which colors of the palette it can safely overwrite with style-specific preferences. For that to work, we need to reset the resolve mask of the synthesized palette (first case) to 0 before polishing. Palettes set explicitly by application code will then have resolve bits set, and the polishing can respect those colors and not overwrite them. Simplify the polish() implementation then to check whether the respective color's resolve bit is set, and only overwrite it with the style's preferred color if the bit is clear. Move that logic into a macro for simplification. This amends b733d31f275d09ca81b5e347ca1e9b6c9b216cd4 and makes sure that colors that are set by the application explicitly don't get overridden by the style. Task-number: QTBUG-124490 Task-number: QTBUG-124286 Change-Id: I69e1e3da93f661ebdafee0b62adbb3d411322443 Reviewed-by: Axel Spoerl <[email protected]>
* QApplication: use focus abstraction instead of QWidget::focus_next/prevAxel Spoerl2024-03-181-2/+2
| | | | | | | | | | | Focus abstraction in QWidgetPrivate makes direct access to QWidget::focus_next and focus_prev an antipattern. Remove usage. Task-number: QTBUG-121478 Change-Id: Iaab97024c20b97a0d9850dce43816a432d4bc7a1 Reviewed-by: Volker Hilsheimer <[email protected]>
* Mention QChronoTimer in API docsAhmad Samir2024-03-031-2/+3
| | | | | Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39 Reviewed-by: Thiago Macieira <[email protected]>
* Fix -Wimplicit-fallthrough for clangTim Blechmann2024-03-011-0/+2
| | | | | | | | | | | | | | | | | | | Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Pick-to: 6.7 Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer <[email protected]>
* QApplicationPrivate::dispatchEnterLeave: remove dead codeAxel Spoerl2024-02-291-13/+0
| | | | | | | | | Remove #ifdef 0 section added in 2011. Task-number: QTBUG-121478 Pick-to: 6.7 Change-Id: I2154cd5616e2695af89cf4fc5ec9d1b3ae5572d5 Reviewed-by: Richard Moe Gustavsen <[email protected]>
* QWidget: deliver DragLeave events symmetricallyVolker Hilsheimer2023-12-201-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | If a widget received a DragEnter event that it didn't accept, then the UnderMouse widget attribute gets set. But the drag manager never got a drag target, so the DragLeave event was never delivered, leaving the UnderMouse attribute set incorrectly. We always need to send DragLeave events to the receiver, even if the DragEnter or DragMove was not accepted. Otherwise we are not in balance, and the UnderMouse attribute will remain set. This is a change of behavior and a very old bug, so only fixing this in unreleased branches. Test case added to verify that explicitly generated drag events result in the correct enter/leave events. [ChangeLog][QtWidgets][QWidget] DragLeave events are now always sent to the widget the mouse is leaving, even if it didn't accept the DragEnter event. Fixes: QTBUG-50403 Pick-to: 6.7 Change-Id: I5eae49da000fb4fea81f1767f0e73a06a6b78975 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Christian Ehrlicher <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* Make QApplicationPrivate::active_window privateTor Arne Vestbø2023-11-201-10/+4
| | | | | | | | | | The active window of QApplication overlaps largely with the focus window of QGuiApplication. As a first step towards potentially removing the active_window member, make it private so we control access to it. Task-number: QTBUG-119287 Change-Id: I95785fea3ba4444db64063f4e4d3d3004465ef64 Reviewed-by: Volker Hilsheimer <[email protected]>
* Add missing timestamp to tablet eventsViktor Arvidsson2023-10-301-0/+1
| | | | | | | | | When copying the event for notify, timestamp was not set as it is for other input events. Pick-to: 6.5 6.6 Change-Id: I81bb89993027c902db2d1113605d6e6a0faf98f1 Reviewed-by: Shawn Rutledge <[email protected]>
* Compress UpdateLater eventsAllan Sandfeld Jensen2023-09-181-0/+5
| | | | | | | | Handle UpdateLater events in QApplication::compressEvents Pick-to: 6.6 Change-Id: I0c63f88d8ed90fc56c093c534394461797d1336b Reviewed-by: Volker Hilsheimer <[email protected]>
* Reset palette resolve mask in windows vista styleSanthosh Kumar2023-09-051-2/+5
| | | | | | | | | | | | | | The palette set by windows vista style during polish doesn't allow style- sheet style to override it. This patch reset resolve mask for the palette set by windows vista style and thus it can be overridden. Fixes: QTBUG-115511 Pick-to: 6.6 6.5 Change-Id: Ifcaf441f806cfa0273599b3dce83fdfaec3f5a66 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* Doc: Mention version of QApplication::setActiveWindow() deprecationKai Köhne2023-08-231-1/+1
| | | | | | Pick-to: 6.5 6.6 Change-Id: I7cd9be3b34a4cb7f396d175ff8137b590c2435c9 Reviewed-by: Volker Hilsheimer <[email protected]>
* Don't set focus when moving the cursor with a touch padVolker Hilsheimer2023-04-281-1/+2
| | | | | | | | | | | | | | | | | | | On macOS, swiping with a single finger on the track pad (which Qt identifies as a QInputDevice::DeviceType::TouchPad) results in a TouchBegin event. For widgets that accept touch events (perhaps implicitly because they want pan gestures, like QGraphicsView), this results in a TouchBegin event to be delivered. QApplication::notify will then check the widget's focus policy, and with ClickFocus set, will set focus on the widget. This is not what we want for a TouchBegin on a touch pad, so skip the setting of the focus for that device type. Pick-to: 6.5 Fixes: QTBUG-112922 Change-Id: Ie828793a784cc0e2fa47954bf5b396d6a44bd5e8 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Clear invalid QApplication styleOverrideKaj Grönholm2023-04-061-0/+2
| | | | | | | | | | | | When QStyleFactory::create() is unable to find/create an override style set with QT_STYLE_OVERRIDE or "-style", clear the styleOverride. Reason for this is that Qt Quick Controls otherwise tries to use this invalid style. Task-number: QTBUG-100563 Pick-to: 6.5 Change-Id: I48fa6c211ce27d902e2eaf90c34cb5694ad7ecfd Reviewed-by: Volker Hilsheimer <[email protected]>
* Trace: Use includes instead of forward declarationsAntti Määttä2023-02-101-0/+3
| | | | | | | | | | Some platforms do not work with forward declarations, mainly android. Pick-to: 6.5 Change-Id: Ie34a30ecb8554d77c1bea4b65a752d63ba819af9 Reviewed-by: Janne Koskinen <[email protected]> Reviewed-by: Hatem ElKharashy <[email protected]> Reviewed-by: Tomi Korpipää <[email protected]>
* Trace: Convert qtwidgets module to use tracepointgen toolAntti Määttä2023-02-101-0/+4
| | | | | | | | Pick-to: 6.5 Change-Id: Iaa993387ecbaeab66c1bd226a85c9ab6d876b157 Reviewed-by: Hatem ElKharashy <[email protected]> Reviewed-by: Tomi Korpipää <[email protected]> Reviewed-by: Janne Koskinen <[email protected]>
* Fix build with -no-feature-draganddropTasuku Suzuki2023-01-171-1/+1
| | | | | | Pick-to: 6.5 Change-Id: I88ecd9a84d7fb9f6cb78027cc51e34089e211ff2 Reviewed-by: Volker Hilsheimer <[email protected]>
* Doc: Fix linking to 'Drag and Drop' topicTopi Reinio2023-01-091-2/+2
| | | | | | | | | | | | | | Linking to 'Drag and Drop' target will link to a page local to Qt Widgets with that section title. The intention is to link to the topic page located in Qt GUI module. Add a descriptive keyword to the correct target page and use that for linking. Pick-to: 6.5 6.4 6.2 Fixes: QTBUG-109289 Change-Id: Ib6a39b43f9080cf5bb72fb07ab163e75eefb4da9 Reviewed-by: Venugopal Shivashankar <[email protected]>
* Fix deprecation of QApplication:setActiveWindow()Kai Köhne2023-01-061-3/+2
| | | | | | | | | | | | | The method is now deprecated in Qt 6.5, not Qt 6.4. Also, keep the documentation for now, but mark it as deprecated there, too. This amends 2436e259ced3. Pick-to: 6.5 Change-Id: Iff3e2c170a8fdb8834c0283de9554b503ed3aca4 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Beautify QApplication::compressEventAxel Spoerl2022-12-091-27/+41
| | | | | | | | | | | Replace if-statement to check compressable event types with a switch. Replace if / else if sequence dispatching to type specific compression code paths with a switch. Replace iterated for loop with a ranged one. Task-number: QTBUG-107808 Change-Id: I9054b625f1898fa793f78de1b477a2113a4e33f0 Reviewed-by: Volker Hilsheimer <[email protected]>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* QApplication: send QHoverEvents with correct scenePosition()Shawn Rutledge2022-10-231-2/+4
| | | | | | | | | | | | | | | | The QHoverEvent ctor takes two points: pos and globalPos; pos is then passed as both the scene and global pos to the QSinglePointEvent ctor, which calls QMutableEventPoint::setScenePosition() on the persistent QEventPoint instance and then detaches befeore setting ephemeral state. Therefore, we must construct QHoverEvent with scene position first, not local position, so that the right value is persisted; it's better to set local position after the detach(), whereas it's too late to fix the persistent point then. Pick-to: 6.4 Fixes: QTBUG-106918 Change-Id: I45726a9ec05bba2fe0cde6f5fb87c269105caca6 Reviewed-by: Volker Hilsheimer <[email protected]>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-111-3/+3
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <[email protected]>
* Fix build with disabled accessibilityAlexey Edelev2022-09-291-1/+1
| | | | | | | | Amends 8539e641f6f48a605547f66c47266d19e537f74e Task-number: QTBUG-106941 Change-Id: Ieffe1ac0050c9f1377e4260376acb2f8cdc0f985 Reviewed-by: Alexandru Croitor <[email protected]>
* Get rid of copypasted code between isWindowBlocked's overridesMikolaj Boc2022-09-201-64/+6
| | | | | | | | | | | | | | | | | The code in QGuiApplication::isWindowBlocked and QApplication::isWindowBlocked is very similar, a result of copying and pasting. Due to the copying it is difficult to modify the code and the implementation is hard to comprehend, too. There are ultimately only two parts that are different. First is that QApplication's override may also specify a certain window as non-blockable if it is a popup window. Second, default modality is computed in QApplication if a modal window does not have one assigned. The differing parts have been extracted following the template method design pattern. Pick-to: 6.4 Change-Id: I3b9aa206a3c7211fe022730943bf6f76aa5ae6d2 Reviewed-by: Volker Hilsheimer <[email protected]>
* Simplify obtaining of parent in isWindowBlockedMikolaj Boc2022-09-121-8/+2
| | | | | | | The new way is more readable as it uses an existing API Change-Id: Id253c9e6405d11f16bdb5f55288dcfcf4b1641c6 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-011-0/+4
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-271-9/+18
| | | | | | | | | | | | | | The function is used the internal window activation machinery and should not be called by user code. Many tests still use this function, and should be ported over to QWidget::activateWindow(). For now they are using the private helper in QApplicationPrivate, so that we can progress with the public API deprecation. Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5 Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Refactor QApplication::event from if/else to switch statementVolker Hilsheimer2022-08-261-8/+16
| | | | | | | | And it wasn't even 'else if' in all the places where it should have been. Pick-to: 6.4 Change-Id: I5a48bfe27cc01fa1fbea1995e8c9cb1be427511a Reviewed-by: Doris Verria <[email protected]>
* Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)Allan Sandfeld Jensen2022-06-151-2/+2
| | | | | | | Pick-to: 6.4 Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Marc Mutz <[email protected]>
* QApplication: Remove QApplicationPrivateBase porting macroThiago Macieira2022-06-131-1/+1
| | | | | | | | | This was last used in 2011, before Qt 5.0 release, when QPA was yet another windowing system, not the only option. Change-Id: Ia4a094014ddb48cc9f6dfffd16f83aad1b7109e7 Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Friedemann Kleint <[email protected]>
* Q*ApplicationPrivate: remove unused "flags" argumentsThiago Macieira2022-06-141-4/+4
| | | | | | | | | | | | | | | | They weren't flags. They were the version of Qt that was used in compiling the application itself. The protection against rollback isn't necessary any more, since qversiontagging.h, which applies to everything and not just the main application binary. And using them to make decisions on functionality or behavior is misguided (see previous commit). This commit does not deprecate the front-end classes' argument. In the future, we may find some need for them. Pick-to: 6.4 Change-Id: Ia4a094014ddb48cc9f6dfffd16f83a7b58ff95d3 Reviewed-by: Volker Hilsheimer <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Remove ALIEN_DEBUG statementsDavid Skoland2022-05-031-15/+1
| | | | | | | | These debug statements come from the Nokia import and it seems unlikely that they are being used at all. Change-Id: I3143f83b0acdc5130fb743808003a55b789f2398 Reviewed-by: Tor Arne Vestbø <[email protected]>