aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickoverlay.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-101-2/+7
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I80bcbfe5faec3d7a2cc0770a99723f13779cf3ce
| * Consider all popups in the stack to test whether an event should be blockedVolker Hilsheimer2021-10-181-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since modal and modeless popups can be arbitrarily nested, it's not enough to just let the first popup in the stack handle an input event to see if it should be blocked. The first popup might be modeless and have a modal parent that then should block events to items further down. So, return true for the first popup that handled the event, otherwise continue down the stack. Fixes: QTBUG-86854 Change-Id: I04fe7833b86353f40cb047cd1330751233dc98c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 85be957e9f936ea2d0fd9d7ceaf5da8eb1bcac49) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-221-20/+20
|/ | | | | | | | | | | This reverts commit 950f8bff7cbbdbd472234fd32ef659c9d0e8ba7c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I69e514934864bea3ccd68de9a65fb08e262325a1 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-221-20/+20
| | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtquickcontrols2. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4209 Change-Id: I4175d7a58cb1b04172132a3bc09aea1b065d1778 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add setAcceptTouchEvents() in controls that handle touch eventsShawn Rutledge2020-10-021-0/+3
| | | | | | | | | | | | | | | This could have been done since Qt 5.10. In Qt 6 it becomes mandatory; so perhaps we will add a qWarning in case an Item handles touch events without declaring that it wants to handle them, to encourage users to do that. This patch will then prevent that warning when using Controls. See qtdeclarative/1457df74f4c1d770e1e820de8cd082be1bd2489e and then qtdeclarative/ab91e7fa02a562d80fd0747f28a60e00c3b45a01 Cherry-picked from dev branch 0ef66bfa 811c6193 and 3c2eab82. Change-Id: I5f9318bd1cad0f760caf02b9066e729af3601098 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-301-1/+1
|\ | | | | | | Change-Id: Icb923b10d2b6c524ebaa8b38c7979b780e3582d4
| * Doc: Fix qdoc warningsVenugopal Shivashankar2019-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | The warnings were about: - Undocumented function parameters - Instances of \instantiates that us an internal class - A few link issues Task-number: QTBUG-79827 Change-Id: I60094279c7da6bc446b5c63b7b4924b71cee4672 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Don't delete items we didn't createMitch Curtis2019-11-281-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until this patch, we've always deleted "old" items when a new one is assigned. For example, the style's implementation of contentItem will be destroyed here as it is not accessible by the user and is no longer used: Button { contentItem: Item { /* ... */ } } This was especially important before the introduction of deferred execution, as the "default" items would always be created, regardless of whether the user had overridden it with one of their own items. By deleting the old items, we free unused resources that would otherwise persist until application shutdown (calling gc() does not result in the items being garbage-collected, from my testing). Although this has largely worked without issues, deleting objects that weren't created by us in C++ is not supported. User-assigned items can be created in QML (with JavaScriptOwnership) or C++ (with CppOwnership), and it is up to the user and/or the QML engine to manage the lifetime of these items. After the introduction of deferred execution, it became possible to skip creation of the default items altogether, meaning that there was nothing to delete when assigning a new, user-specified item. This requires that no ids are used in these items, as doing so prevents deferred execution. Assuming that users avoid using ids in their items, there should be no unused items that live unnecessarily until application shutdown. The remaining cases where items do not get destroyed when they should result from the following: - Imperative assignments (e.g. assigning an item to a Button's contentItem in Component.onCompleted). We already encourage declarative bindings rather than imperative assignments. - Using ids in items. Given that these are use cases that we will advise against in the documentation, it's an acceptable compromise. [ChangeLog][Important Behavior Changes] Old delegate items (background, contentItem, etc.) are no longer destroyed, as they are technically owned by user code. Instead, they are hidden, unparented from the control (QQuickItem parent, not QObject), and Accessible.ignored is set to true. This prevents them from being unintentionally visible and interfering with the accessibility tree when a new delegate item is set. Change-Id: I56c39a73dfee989dbe8f8b8bb33aaa187750fdb7 Task-number: QTBUG-72085 Fixes: QTBUG-70144 Fixes: QTBUG-75605 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQuickOverlay: use qobject_cast instead of static_castFabian Kosmale2019-11-271-1/+2
|/ | | | | | | | | | | | | | | | | This mirrors the behavior of QQuickOverlayPrivate::addPopup While this might not be an issue in practice, as removeOne should fail nevertheless, this avoids a warning from UBSan and should have only a negligible performance impact. The warning appears for instance in the (otherwise unrelated) example from bug QTBUG-80070: qquickoverlay.cpp:258:63: runtime error: downcast of address 0x55d6e1b34860 which does not point to an object of type 'QQuickDrawer' 0x55d6e1b34860: note: object is of type 'QQuickPopup' Change-Id: Ic51979ad25e864151245b6d47c733696a099bde8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: micro optimization for disabled multitouch supportKonstantin Ritt2019-09-131-6/+14
| | | | | | | | avoid checking every press event to be one of touch events type when touch events are not delivered at all Change-Id: I1ed91fa124608d8a006cf2f5256ad68294dd465f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix crash on exit when using a shader and a PopupSimon Hausmann2018-07-161-1/+1
| | | | | | | | | 3b5143bb67cdaaff6b0eabedff1034e4add7ec87 already fixed a crash with the same stack trace in dev. The same fix works with the referenced bug report. Task-number: QTBUG-66483 Change-Id: I05450d2ff40f317d9b5b59e28991fa92b414022e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: provide code snippets for Overlay.modal and Overlay.modelessMitch Curtis2018-07-101-0/+10
| | | | | Change-Id: I0ea789c0ba3a153b00ac3ab6501ecf10f6c733ce Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-16/+3
| | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Document how to position a popup in the center of the windowMitch Curtis2018-02-161-19/+2
| | | | | | | | | This was already in Overlay's docs, but not Popup's, so this patch moves the example to a .qdocinc and includes it in both places, creating a new Popup Positioning section in the process. Change-Id: I8e8438919fd849a8466b3a28133d22bb45f7dc19 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-5/+43
|\ | | | | | | | | | | | | Conflicts: tests/auto/popup/tst_popup.cpp Change-Id: I32e6c6b646a00f8805cb82d181417db60a6fe6c8
| * Popups: take Window::contentOrientation into accountJ-P Nurmi2017-07-271-5/+43
| | | | | | | | | | | | Task-number: QTBUG-62158 Change-Id: I0bcf5b02da6a3500e4324462d5f1249a6178c9fd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-111-1/+6
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/controls/data/tst_scrollindicator.qml Change-Id: I1f5581ae7814c0d4152e4c9b79a30a8af5a3a17b
| * Fix modal overlay to block multi-touchJ-P Nurmi2017-07-041-1/+6
| | | | | | | | | | | | Task-number: QTBUG-61698 Change-Id: I46db5e9816190ac7afd6b671198dff11089bc4f3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add Overlay attached properties and signalsJ-P Nurmi2017-06-261-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Controls][ApplicationWindow] Deprecated the overlay grouped property in favor of the newly introduced Overlay attached properties. [ChangeLog][Controls][Overlay] Introduced Overlay attached properties and signals that supersede the overlay grouped property in Application Window. The Overlay attached type allows providing background dimming for popups without requiring an ApplicationWindow instance. Task-number: QTBUG-61336 Change-Id: I9df11bcb167e7725014d5f058fe24d70da4a10b3 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Move visual overlay background management to QQuickPopupJ-P Nurmi2017-06-231-122/+1
|/ | | | | | | | | | | | | | During the early days, there was only one visual overlay background dimmer, so QQuickOverlay was the natural choice to manage it. It was soon realized that multiple modal popups and drawers needed each their own background dimming. Now the implementation becomes simpler when each popup manages its own background dimming. This paves the road for the upcoming changes making it possible to provide background dimming without ApplicationWindow. Task-number: QTBUG-61336 Change-Id: I621db4efe4aa74c147f81f7aee8affebddb00d49 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Let users disable the multi-touch supportJ-P Nurmi2017-06-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix drawers not to be touch-draggable through modal popup shadowsJ-P Nurmi2017-05-081-13/+16
| | | | | | | | | | | | | | Material style popups have a shadow outside the popup. QQuickOverlay cannot block press events to children of a popup, because otherwise interacting with popup contents would be impossible. However, since the shadow is outside of the popup, touch events don't propagate to the popup and get naturally blocked by the popup background. Instead, the touch event propagates to the overlay. At this point, we must do an additional check whether we're allowed to start dragging a drawer. Task-number: QTBUG-60602 Change-Id: I9b5c81246bca7ea40bce0e46dc2e94558a0b9204 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: reduce one event filterJ-P Nurmi2017-04-281-52/+49
| | | | | | | | | | | | | Instead of using the window content item for detecting when mouse and touch events propagate through the item hierarchy without being accepted/handled, utilize QQuickWindowPrivate::handleMouse/TouchEvent() to deliver the respective events from the window-level even filter. That way we can unconditionally accept mouse and touch events after the delivery to the item tree, to ensure receiving the consequent mouse and touch events. Change-Id: I5f70c2e0e0d931c544461261721cc9b17ce8d3ef Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix Popup.CloseOnRelease for non-modal popupsJ-P Nurmi2017-04-271-6/+70
| | | | | Change-Id: I70ac251a02a7856e6770cdb9b3e5b2a2d027d133 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: add handleMouseEvent() and handleTouchEvent()J-P Nurmi2017-04-271-58/+88
| | | | | | | | To unify overlay event delivery from the child event filter and the event handlers in QQuickOverlay itself. Change-Id: I0e867baeda3a8b829fe1d1992ea8289d466afc85 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickOverlayPrivate::startDrag()J-P Nurmi2017-04-271-13/+19
| | | | | Change-Id: I9558f82cb7330e451c043e25c9a140f49eefa219 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickOverlay: add return value to handlePress/Move/Release()J-P Nurmi2017-04-271-9/+14
| | | | | | | Inform the caller whether the event was handled. Change-Id: I9433164ec810f55e760960dd70e4539c5722e775 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Popups: fix non-dimming modal background leaking events throughJ-P Nurmi2017-04-261-3/+8
| | | | | | | | | | | This piece of code, which was thought unnecessary, went missing when moved from mousePressEvent() to handlePress() in 7faafa4. It is needed after all for non-dimming modal popups, because in that case we simply cannot rely on the background dimming blocking the press... Task-number: QTBUG-60405 Change-Id: I53d89133eeae4ad8531b3c1e07c3b22295d438de Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Implement QQuickOverlay::touchEvent()v5.9.0-beta3J-P Nurmi2017-04-211-37/+88
| | | | | | Task-number: QTBUG-58389 Change-Id: I59b2936fd0c984c2dc7c1d3c49fb78c1fa950be7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::startDrag(): remove superfluous argumentJ-P Nurmi2017-04-211-1/+1
| | | | | | | | | | Popups used to have a valid window-pointer only when they were visible, but now the window is automatically looked up from the parent item. There is no need to pass the window pointer from the overlay anymore, because the drawer already knows the window. Change-Id: I9652607217a82af2be89f6ab4490431556e3d17c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Set explicit cursors on all interactive controlsJ-P Nurmi2017-04-051-0/+3
| | | | | | | | | | | | For example, if you have a floating button on top of a text editor, hovering the button must change the cursor from the editor's ibeam cursor to an arrow cursor. This applies to all interactive controls that call setAcceptedMouseButtons(). If a control blocks mouse events, it should not use some random cursor from another control underneath. Task-number: QTBUG-59629 Change-Id: I8a6ae306bbc76a9b22377361cb19cf9c3a872d31 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Pass a parent to QQmlContextsMitch Curtis2017-03-241-1/+1
| | | | | | | | To avoid crashes in the future. Task-number: QTBUG-59532 Change-Id: Ie81f95939fc5655567f9d987cf040daf3a32df43 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Add "hover support" configure featureJ-P Nurmi2017-02-061-0/+2
| | | | | | | | | | ./configure -no-feature-quicktemplates2-hover [...] Qt Quick Templates 2: Hover support .......................... no Change-Id: I0509a1a9ac3ffe2cbfe4f2016ce0345708860b84 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build with -no-feature-wheeleventJ-P Nurmi2017-01-311-0/+2
| | | | | Change-Id: I6f40794ae1977d1f23916bff6d0c58d44440fbe5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Format initializer listsJ-P Nurmi2017-01-191-3/+3
| | | | | | | | Initialize one member per line. Allow empty constructors with one initialized member on a single line. Change-Id: Ie115802561ebd19efd4dacda1fa868b64d279109 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-12-011-5/+12
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/SpinBox.qml src/imports/controls/material/SpinBox.qml src/imports/controls/universal/SpinBox.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ie1d1f487890f0a9f80a00df5e813e1d2e8303fe5
| * Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-5/+12
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc sync.profile Change-Id: I554c40516030075142f9af1dd5c66fdca2b78b9a
| | * Fix popups to close on click outsidev5.7.1J-P Nurmi2016-10-251-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a popup closes itself on press outside, it accepts the press event so that it doesn't propagate to other popups or the content below. We must make sure that such closing popup does not become the mouse grabber, because it doesn't make sense to route the subsequent mouse events to the popup that was just closed. Change-Id: I80c6e26a1d94aa1526a61862f00af2fd0778aa82 Task-number: QTBUG-56697 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Move QQuickPopupItem out of qquickpopup.*J-P Nurmi2016-10-261-0/+1
|/ / | | | | | | | | | | | | | | | | | | We'll start slowly refactoring all QQuickPopupItem-specific things out of QQuickPopup. In the future the presentation/backend of a popup could be, under certain circumstances, a native menu popup window, for example. Change-Id: I8508da14ab52c65221afc3a9b7f07c371f0416d2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-261-3/+14
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quickcontrols2/gallery/gallery.qrc src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc src/quicktemplates2/qquickstackview_p.cpp src/quicktemplates2/qquickstackview_p_p.h tests/auto/controls/data/tst_stackview.qml Change-Id: If451fe0e5653572d305b4de90a6d5cb878463e8d
| * Fix nested popupsJ-P Nurmi2016-09-231-3/+13
| | | | | | | | | | | | Task-number: QTBUG-56136 Change-Id: I3ed7fae09c342c2c456b94fc0cfed781d8edf6aa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Fix QQuickOverlay::childMouseEventFilter() to release the grabber popupJ-P Nurmi2016-09-231-0/+1
| | | | | | | | | | | | Change-Id: Id9d844d1fc75f4d254abaf1681747b7b521e881b Task-number: QTBUG-56131 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-221-13/+7
|\| | | | | | | Change-Id: I37aab846346692fd4bff08b0dbab66db3a8e2716
| * Move resizeOverlay() to QQuickPopupPrivateJ-P Nurmi2016-09-211-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparation step for making drawers movable. Drawer must be later able to resize the overlay to fit the area of the window that is covered by the drawer. For example, if the Drawer is below the header, it can resize the overlay so that it won't be on top of the header. Change-Id: I2cfd025a31f3a517575f3dbf9b972dcd6957715c Task-number: QTBUG-53168 Task-number: QTBUG-55360 Task-number: QTBUG-53609 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: fix drag to close from the outside on touchJ-P Nurmi2016-09-191-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set mouseGrabberPopup in QQuickOverlay::childMouseEventFilter() the same way it is set in QQuickOverlay::mousePressEvent() to ensure that the consequent mouse move events are routed to the appropriate popup. This worked with "genuine" mouse move events that were caught by the same child mouse event filter and that way routed to the appropriate popup, but not with "synthesized" mouse move events that are caught by QQuickOverlay::mousePressEvent() instead. Change-Id: Ic59afd85e55c13ebec482bc4dc534accd1f92b2c Task-number: QTBUG-56010 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-141-0/+16
|\| | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h Change-Id: Ie7b4a114ad27a4cad337c91e8ebcf696b0e845d7
| * Fix modal overlays leaking wheel events throughJ-P Nurmi2016-09-131-0/+16
| | | | | | | | | | | | Change-Id: I1a3be5ef02cf73a153cebc030313f892fbb03d9f Task-number: QTBUG-55769 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-061-111/+155
|\| | | | | | | Change-Id: Ief98cd56abd13cfa4e30578e150207462a8243b8