aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qquickpopup
Commit message (Collapse)AuthorAgeFilesLines
* Blacklist some flaky tst_qquickpopup functions on openSUSEMitch Curtis2021-06-161-0/+9
| | | | | | | Task-number: QTBUG-94251 Pick-to: 5.15 6.1 6.2 Change-Id: I5f06bba2522c07a29897501932c02b87e9cae356 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qquickpopup: Don't leak created objectsUlf Hermann2021-06-151-1/+2
| | | | | Change-Id: Ie1359fb407088adcc91b45ae18c682dda8822a67 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Stabilize tst_qquickpopupFabian Kosmale2021-06-092-22/+33
| | | | | | | | | | | - Give the window system some time to change the cursor - Wait for popups to be properly opened and closed Task-number: QTBUG-94251 Change-Id: Ie380312daddcb2ee95f337c321ca2724c3b9f182 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Update to latest qml CMake APICraig Scott2021-06-051-1/+1
| | | | | | | | | | | | | | The new qml CMake API places a closer relationship between the backing target and the plugin target. Both are typically created together and they share a lot of common details. Instead of creating them in different parts of the source tree, they are now specified together. The src/imports area has effectively been absorbed into the other corresponding subdirectories below src with this change. Task-number: QTBUG-91621 Change-Id: I9bd32e9eb78c198ccc9db04e2829303cac323502 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add findViewDelegateItem function to visualtestutils.hMitch Curtis2021-04-221-0/+1
| | | | | | | | | | This helper function finds an item view delegate instance at a given index, ensuring that the view is polished and positioned at the correct index if necessary. Change-Id: Ib133914df723251835be3812c1d0654c07a99f14 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix compiler warnings, add overrideVolker Hilsheimer2021-03-171-1/+1
| | | | | Change-Id: I547e94213f4b4d2c3ca3aeaa06330069e6311043 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tests: Do not delete device prematurelyFabian Kosmale2021-03-011-1/+1
| | | | | | | | The delivery agent expects the device to live longer than itself. Pick-to: 6.1 Change-Id: I3c837633f2c4a91f5b370df4d486a01b2ee05f13 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Blacklist flaky tests in tst_QQuickPopup on macOSTor Arne Vestbø2021-02-151-0/+8
| | | | | | Task-number: QTBUG-89938 Change-Id: I3602056fa3f7f0227b80c6c775153bd444c88f24 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Remove QMake project filesJoerg Bornemann2021-02-111-14/+0
| | | | | | | | | | This includes removal of the corresponding .prev_CMakeLists.txt files. Pick-to: 6.1 Task-number: QTBUG-88742 Change-Id: I4247294258629c92e80914518e9208019090c815 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix popups with exit transitions blocking mouse events when destroyedMitch Curtis2021-01-132-0/+144
| | | | | | | | | | | | | | | | | | | | | | If a popup had an exit transition set and was destroyed upon e.g. being rejected, it would not destroy its modal dimmer, and so events would not go through to popups that were beneath it even after it was destroyed. QQuickPopup's destructor does indirectly attempt to call finalizeExitTransition() through a setParentItem(nullptr) call, but prepareExitTransition() returns false if it sees that the exit transition is already running, and so transitionExit() never calls finished(). This patch fixes the problem by explicitly calling finalizeExitTransition() in QQuickPopup's destructor if the exit transition is running. Fixes: QTBUG-89673 Pick-to: 5.15 6.0 Change-Id: I468fae52f6a83ac314877c67d062028634bb7e17 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-071-3/+3
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I4a690095fcd4b1141550de86b6820ae2dd579429 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Native style: set a sensible default width for TextFieldRichard Moe Gustavsen2020-09-071-0/+1
| | | | | | | | | | Set the default width of an empty TextField to 90px (which is a number found by creating an NSTextField in XCode and measuring it with pixeltool). This should also make tst_QQuickPopup::macOS::cursorShape() pass. Change-Id: Ia2a059668c2e1eaea3eef20015a8ea99468dd8ad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix tst_qquickpopup::invisibleToolTipOpen() failing on subsequent runsMitch Curtis2020-09-041-0/+3
| | | | | | | | | I don't know why this is necessary, but without it, the mouse area doesn't get any mouse events on subsequent runs (tested with QT_LOGGING_RULES=qt.quick.mouse=true). Change-Id: I69fa13ad282789f522542e52a945973fee66f44d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* auto tests: remove all versioning from the test dataRichard Moe Gustavsen2020-09-041-3/+3
| | | | | | | | | | | | The problem is that QtQuick.Controls.macos is only available with revision 6.0. And when importing e.g QtQuick.Controls 2.15, we try to load a style with the same revision. But it simply doesn't exist. So remove all versioning from the tests to also support testing newer styles. Change-Id: I666a93ab03ec4c5dcf2055a363547f8cdac8d25e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix CMake buildMitch Curtis2020-08-261-0/+1
| | | | | | Task-number: QTBUG-82922 Change-Id: I75f4a553a6bb260f77bfa791f12fa42e80131e09 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove all version numbers from QML importsMitch Curtis2020-08-2623-59/+59
| | | | | | | | | As of Qt 6, the latest version will be used by default. This saves us a lot of effort in terms of version bumps. Task-number: QTBUG-82922 Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qquickpopup: fix setOverlayParentToNull testMitch Curtis2020-08-241-0/+2
| | | | | | | | Use the fix from 1d06eb3f8215b67c5061ee3a076df405724ff7ee. Fixes: QTBUG-86212 Change-Id: I407c56741806340235da81cca943b50cc6e92dd2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix crash on exit when centering Popup within Overlay in StackView itemMitch Curtis2020-07-142-0/+97
| | | | | | | | | | | If a Popup is centered within an Overlay, and that Overlay is destroyed before the Popup, we must make sure centerIn is cleared so we don't try to access a dangling pointer. Fixes: QTBUG-84579 Pick-to: 5.15 5.12 Change-Id: Icb2750f847f9d5710725bedc4d1c92bf4c122c03 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update dependencies on 'dev' in qt/qtquickcontrols2Qt Submodule Update Bot2020-06-251-12/+1
| | | | | | Change-Id: I1f6bf96f30f5dcea4d9838b0638f9412309a069e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io>
* QQuickApplicationHelper: don't use QTest macros outside test functionsMitch Curtis2020-06-171-0/+24
| | | | | | | | | This has no effect. Task-number: QTBUG-66320 Pick-to: 5.15 5.12 Change-Id: Ie6efb26243178c4044ac0bc721c21ad89769c982 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Skip tests that use graphical effects on Win 7Mitch Curtis2020-05-261-0/+8
| | | | | | | | | It's not clear why these fail, but we can live without the test on Windows 7. Fixes: QTBUG-84443 Change-Id: Ib18dfc8e12528c5086d07d6018cda93fb6e8d30c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove ignoreMessage from setOverlayParentToNullLaszlo Agocs2020-05-181-3/+0
| | | | | Change-Id: Ie678693280b374e5977a3870b395936d15023579 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Massage toolTipCrashOnClose testLaszlo Agocs2020-05-181-5/+0
| | | | | | | | | | | | | | | | | | QTest::ignoreMessage() has a feature, namely that: If the test finished and the message was not outputted, a test failure is appended to the test log. So here, if Graphical Effects is available, but not functional, ShaderEffect fails to initialize, which means the warning-to-be-skipped is never outputted. The test would pass (because the visual appearance does not matter), but the ignoreMessage() condition fails it. Adding a QSKIP is not a solution because ignoreMessage() would still do its check and fail the test! Therefore, remove the ignoreMessage() altogether. Change-Id: I3e096752dfc6894c77859e786c8a4cac01d6fc53 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Reduce dependencies on QtGraphicalEffectsMitch Curtis2020-05-131-0/+3
| | | | | | | | - Make QtGraphicalEffects optional in tests - Mention that QtGraphicalEffects is required for relevant examples Change-Id: I3ac7d06add931e0a10c3df7edc4e458ba5519c75 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove old QQuickPalette implementationVitaly Fanaskov2020-03-181-20/+21
| | | | | | | | | | | | | | The existing implementation was removed in order to reduce massive code duplication and simplify color resolving process. Unit tests were fixed accordingly. See related changes in the qtdeclarative module for the further details. [ChangeLog][General] the palette API is a part of QQuickItem now. Change-Id: Ic94ab4632e626c11d9b26f035e2a8a119c9088ef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Regenerate projectswip/cmakeAlexandru Croitor2020-03-171-9/+5
| | | | | | Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-173-1/+187
|\ | | | | | | Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
| * Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-03-102-0/+56
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/qtquickcontrols2plugin.cpp Change-Id: Ifc09ea9f71fdba119fe8eed99f0bdcb402444f27
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-02-152-0/+56
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/qquickpopup/tst_qquickpopup.cpp Change-Id: Id3bca2da290234f3c69845ffe18c6d9193a1bd28
| | | * QQuickToolTip: prevent closing after invisible tooltip createdWang Chuan2020-01-112-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since all items using ToolTip attached property share the same ToolTip item, a dynamically created invisible Tooltip may unexpectedly close the current visible ToolTip. Fix this issue by checking the parent of ToolTip when trying to close it Fixes: QTBUG-78202 Change-Id: I0f6558040c6b8bf22240b0c94af912a43d525ed9 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2019-11-302-1/+131
| |\| | | | | | | | | | | | | | Change-Id: Ie6039c9ad6c5b0d5077383f0a797be320cd34739
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-302-0/+129
| | |\| | | | | | | | | | | | | Change-Id: Icb923b10d2b6c524ebaa8b38c7979b780e3582d4
| | | * QQuickPopup: fix focus when multiple popup exitingWang Chuan2019-11-252-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a focused Popup exited, it will try to transfer focus state to next Popup in chain or other item. However if there is an unfocused Popup exiting simultaneously, the focus state will be transferred to unfocused Popup, and this will cause loss of focus state since an unfocused Popup won't transfer its focus state to next Popup(or item) Fixes: QTBUG-79464 Change-Id: Ic06bd5a3616c8afbce449266e6fc24d2d54059d9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * | Avoid initializing QFlags with 0 or nullptrFriedemann Kleint2019-11-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is being deprecated. Change-Id: I69effb678ee29d9c98bdd51dc898845869211bcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-231-1/+2
| | |\| | | | | | | | | | | | | Change-Id: I36a4d6043e00d97dc98cc9c77aa294a058574f47
| | | * Attempt to stabilise tst_qquickpopup::closeOnEscapeWithVisiblePopup()Mitch Curtis2019-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's flaky on openSUSE. Whenever it would fail, the activeFocusItem was always null, so check for that before doing the key press. Change-Id: Ib31d4869902b40424b3994d1d468a3eace8847f0 Fixes: QTBUG-80164 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-253-6/+196
|\| | | | | | | | | | | | | | | Change-Id: I61919fabd4a3a07ed374f2c3c1fae2d589d6e124
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-162-0/+32
| |\| | | | | | | | | | | | | | Change-Id: I647fa31fafdaea46c341c515f97b7f793ddf4b31
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-092-0/+32
| | |\| | | | | | | | | | | | | Change-Id: Ib14b8c77cefe7aaf5b11483d9a30b2ef05314598
| | | * QQuickPopup: try to grab shortcut when component completedWang Chuan2019-10-292-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If closePolicy of Popup is set to CloseOnEscape and the Popup is completed, shortcut will register to QGuiApplication to let Popup respond to Escape key. However if Popup is set to visible in creation, even if we set closePolicy to CloseOnEscape, the shortcut won't be registered. [ChangeLog][Controls][QQuickPopup] Fixed the issue that Popup doesn't respond to CloseOnEscape if the initial value of visible is true Fixes: QTBUG-79326 Change-Id: I90c6805e2b4d567a6e0d33d43a75fedcfc5416b3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-091-0/+2
| |\| | | | | | | | | | | | | | Change-Id: I80f13e604dd492954c742e0ddaa7efa393776a62
| | * | Non-modal popups shouldn't set isTabFenceMarco Martin2019-11-042-0/+154
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a popup is not modal, all the application's main content can still be interacted with, therefore should still be possible to navigate it with tab. This issue is particularly evident with Drawer, also commonly used as a sidebar, in which tab navigation should always work. Fixes: QTBUG-79501 Change-Id: I0e8ad2e1abe57b9617c6316efbfe2f296c91b592 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 3358362e61ef96b3922a438d0806561285c49230)
| | * Fix tst_qquickpopup failure on Windows 7 MinGWMitch Curtis2019-10-231-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: I42b6a7050886f795e267893aa5eeaaf7a5841971 Fixes: QTBUG-79370 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Non-modal popups shouldn't set isTabFenceMarco Martin2019-10-292-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a popup is not modal, all the application's main content can still be interacted with, therefore should still be possible to navigate it with tab. This issue is particularly evident with Drawer, also commonly used as a sidebar, in which tab navigation should always work. Fixes: QTBUG-79501 Change-Id: I0e8ad2e1abe57b9617c6316efbfe2f296c91b592 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-191-6/+8
| |\| | | | | | | | | | Change-Id: I770f99d20878ddf16ab3f4b1a5422e7192622f64
| | * tst_qquickpopup: ignore ShaderEffectSource warning in debug buildsMitch Curtis2019-10-111-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was commented out but should have been #ifdef'd, and the explanation is wrong. This amends 83fbf44. Change-Id: Ibe752d63a42805361b13edc6beafcf1f3738f02f Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Regenerate projects to be in syncAlexandru Croitor2019-11-151-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: I3a57449c9025e22414b8337fcffdeb0f4d769af2 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-152-2/+140
|\| | | | | | | | | | | | | | | | | Removed dependencies.yaml. Change-Id: I1e2b3f486e9ace4bc8dc0419a64848990b3a6b39
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-122-0/+136
| |\| | | | | | | | | | Change-Id: Ibdfd1048941c55bcf6abe101cad2b58a2ea9e776
| | * Fix a crash on exit when using ToolTip in a specific item hierarchyMitch Curtis2019-09-302-0/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickPopup connects its parent item's (MouseArea, in this case) windowChanged() signal to QQuickPopupPrivate::setWindow(). It does this so that: 1) QQuickOverlay can keep track of all of the popups that it manages. 2) Fonts, palettes and locales can be resolved. 3) If the QQuickPopup component has completed loading and the popup is visible with a valid window, start the enter transition. The problem arises only when using a very specific item hierarchy: Window { width: 640 height: 480 visible: true Item { anchors.fill: parent Item { anchors.fill: parent ColorOverlay { source: parent anchors.fill: parent } MouseArea { anchors.fill: parent hoverEnabled: true ToolTip.visible: containsMouse ToolTip.text: "ToolTip text" } } } } When the window is closed and hence begins to be destroyed, the following events occur: - QQuickWindow's destructor is called. - The window's root item (QQuickRootItem) begins destruction. - QQuickOverlay is destroyed. - QQuickWindow's destructor is done, so the QWindow and then QObject destructors are called. - The QQuickItem destructor for the outer Item is called. - The child items of the outer Item have setParentItem(nullptr) called on them, one of which being the inner Item. - The inner Item's setParentItem() function calls derefWindow(), which in turn calls derefWindow() on its children. One of those children is MouseArea. - Since the MouseArea's window is deref'd, it emits the windowChanged() signal. MouseArea is the parentItem of the popup, so its windowChanged() signal causes QQuickPopupPrivate::setWindow() to be called. - setWindow() tries to remove the popup from the old overlay, which has already been destroyed. One approach I tried involved using QQuickOverlay::itemChange() to remove all of the popups (via setWindow(nullptr), to ensure that their window pointer is nullified), since that was called much earlier than the windowChanged() signal is emitted. However, this still resulted in a heap-use-after-free in the same place when running the newly added setOverlayParentToNull() test. I also tried removing the popups in QQuickOverlay's destructor, but this resulted in another heap-use-after-free (when accessing a popup in the destructor) in tst_QQuickPopup::Universal::visible(). The remaining options were: store the window in a QPointer or return early in overlay() if the wasDeleted member of the window was true. Using QPointer seems like it would catch more issues than a single check in overlay(), so I went with that. Fixes: QTBUG-73243 Change-Id: Ieb5ce26dd76d45771d28297031ec43e27d958b5b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>