aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickdialogs/qquickfolderdialogimpl
Commit message (Collapse)AuthorAgeFilesLines
* DialogButtonBox: add properties for setting a default buttonOliver Eftevaag2025-11-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick Controls lacked the ability for setting a default button in a dialog button box. This is something that we support in QtWidgets, and it makes sense to allow dialogs with a DialogButtonBox set as the footer to decide if a particular button should be default, and have focus when the dialog is opened. With this patch, we're introducing two different ways for selecting a default button. The first is the usage of the DialogButtonBox::defaultButton property, which works like this: ``` DialogButtonBox { defaultButton: Button { text: qsTr("Ok") } Button { text: qsTr("Cancel") } } ``` In the snippet above, the Button that is set as default should both be highlighted, and be the sub focus item of the DialogButtonBox. However, since the standardButtons property can be used to dynamically create buttons on the fly, we also needed an alternative way for picking a default button. In cases where standardButtons is being used to create buttons in the DialogButtonBox, the new defaultStandardButton property can be used: ``` DialogButtonBox { standardButtons: DialogButtonBox.Yes | DialogButtonBox.No defaultStandardButton: DialogButtonBox.Yes } ``` Something worth noting, is that the DialogButtonBox's contentItem is typically a ListView. ListView have the ItemIsFocusScope flag set, meaning that we need to give focus to both the ListView, and the default Button. In addition, the FontDialog and ColorDialog will now make the Ok button default, and give it focus when the dialogs are opened. The FileDialog and FolderDialog will continue to give the ListView focus, since that's IMO more user friendly. The MessageDialog will need new API to take full advantage of this new feature, which will be introduced later. [ChangeLog][DialogButtonBox] The DialogButtonBox now has two new properties, defaultButton and defaultStandardButton. When one of these properties are being used, a button set as default will be highlighted and receive activeFocus whenever the DialogButtonBox gets focus. If a DialogButtonBox is assigned as a Dialog's footer, it will also get focus when the Dialog is opened. This means that a Dialog with a DialogButtonBox as its footer, will give focus to a default button when opened. If both of these properties are unset, the first button with the AcceptRole will get focus, but it will not be highlighted. Fixes: QTBUG-58246 Fixes: QTBUG-139352 Change-Id: Ic083410184dd63e0e790694f782a7a98c1dc8b6e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Propagate modality to the non-native quick dialogsSanthosh Kumar2025-07-092-0/+94
| | | | | | | | | | | | | | | The non-native quick dialogs don't block input to the windows even after setting the modality as ApplicationModal/WindowModal. This is because non-native platform dialogs (QuickPlaform*Dialogs) didn't set modal to its respective window (QQuickPopupWindow). This patch fixes that issue by setting the modality to the non-native platform dialogs. Task-number: QTBUG-127605 Pick-to: 6.10 6.9 6.8 Change-Id: Idb3374e881766ae92adc0360c9b9af5c498dd6df Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* tst_QQuickFile/FolderDialogImpl: use canonical pathsMitch Curtis2025-06-111-50/+60
| | | | | | | | | | | | | | | | | This adapts to 7bd7df5aa170c240061144a9210a13b62949935c. The test was expecting e.g. this path: /var/folders/0r/vd385j117f949qnfm4h_539w0000gn/T/tst_qquickfiledialogimpl-dqvSBE/sub-dir But the actual path was this: /private/var/folders/0r/vd385j117f949qnfm4h_539w0000gn/T/tst_qquickfiledialogimpl-dqvSBE/sub-dir Fixes: QTBUG-137416 Pick-to: 6.5 6.8 6.9 6.10 Change-Id: I31b929017ebb1a672a614f8b409dc5c4e8d5e000 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQuickTest: add and use active focus macrosMitch Curtis2025-04-251-1/+1
| | | | | | | | | | | | | Also add support for popups (when controlstestutils_p.h is included). [ChangeLog][Qt Quick Test] Added QVERIFY_ACTIVE_FOCUS and QTRY_VERIFY_ACTIVE_FOCUS macros that can be used to get detailed failure messages for when QQuickItem::hasActiveFocus should be true but isn't. Task-number: QTBUG-133858 Change-Id: I30c67a84ccc16e3969bac5661648d0062bc3d62c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add Qt::Qml before Qt::QmlPrivate to auto testsKarim Pinter2024-10-221-0/+1
| | | | | | | | | | The build for auto tests for VxWorks fails because Qt::Qml is not added before Qt::QmlPrivate resulting in many unresolved symbols from Qt::Qml library. When Qt::Qml is added before it solves this problem. Task-number: QTBUG-129113 Change-Id: I89d553ac1d6706e2e934665fed2f308e6b01ed78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Enable popup windows for QtQuick.DialogsOliver Eftevaag2024-07-231-20/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | The dialogs in QtQuick.Dialogs look so much better on desktop systems, when they appear inside real top level windows. This change enables the feature for all QtQuick.Dialogs types, and makes manual changes to each dialog, to make sure that they look good. This includes changes that hides the title from the header, since the title can now appear inside the window decoration instead. Lots of tests had to be changed, as a result, to properly generate and deliver events to the correct items. In addition, I've added some helper functions to dialogHelper, to handle cases we're we need to wait for a popup window to appear. Showing popups with dedicated windows, takes longer than simply creating a new item in an existing window. [ChangeLog] All dialogs in QtQuick.Dialogs will now use popup windows, if able. Fixes: QTBUG-126006 Pick-to: 6.8 Change-Id: Ieca6ae643d4f97b1bed648e448bbcd236a50e7e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix binding loop that occurs in QtQuickDialogs using popup windowsOliver Eftevaag2024-07-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Here's a vague description of the loop: 1. The implicitWidth binding of QQuickDialog needs to be evaluated. Call setImplictWidth(). 2. QQuickPopupItem::geometryChange() and QQuickPopup::geometryChange() are called, 3. QQuickPopupPositioner::reposition() is called. 4. QQuickPopupPrivate::windowInsets() is called, to be used as positional offsets. This ends up calling QQuickControl::background(). 5. Because of deferred execution, the background wasn't already initialized. Needs to be lazily initialized instead. 6. QQuickPopup::setBackground() and QQuickPopup::implicitBackgroundWidthChanged() are called. 7. Reevaluate implicitWidth binding. 8. Theoretically back to 1. which is why it's a loop. The fix here, is to avoid calling QQuickControl::background() in QQuickPopupPrivate::windowInsets(), but instead access the data directly, if the background is executing. Pick-to: 6.8 Change-Id: I89f5f92cd9f2dc5f78070a3cf1e21dc6bfdd10f7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Give QQuickPopup the ability to create top-level windowsOliver Eftevaag2024-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Desktop users typically expect dialogs to be top level windows, but there can also be advantages to having other types of popups, such as Menus, and ToolTips, be top level windows as well. Currently the QQuickPopup class is tightly coupled with the QQuickPopupItem which it creates, and forwards a bunch of properties to. But we want Popup to seamlessly create a new window, which renders the popup item. This should serve as a new feature, which is primarily targeted for desktop users, and should not replace the old behavior, since having the popup item in the same window will likely be preferred for mobile and embedded users. The default behavior will now be to create a popup window, when the QML application is running on a desktop system (determined by the platformIntegrations capabilities). It's also possible to opt out of this new behavior, by setting the AA_DontUsePopupWindows application attribute flag. The dialogs in QtQuick.Dialogs should now also appear in their own dedicated window, since they were using QQuickDialog behind the scenes. The combobox popup, will also appear in its own window. Some changes, such as modality, won't take effect until the window is reopened, since the window is destroyed/recreated on visibility changes. Done-with: Ed Cooke <ed.cooke@qt.io> Task-number: QTBUG-121363 Change-Id: I21f4fd1f922219359d3258854bdcdc9be6980f4f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix test compilation issues with QtLite configurationJari Helaakoski2024-04-301-0/+14
| | | | | | | | | Now developer build tests compile, but some are not working. Functional fix will come later via separate tasks. Task-number: QTBUG-122999 Change-Id: I0a0dfcf7affb73f928b8be62b3576a6a51658488 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Correct license for test filesLucie Gérard2024-02-275-5/+5
| | | | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Normalize signal/slot signaturesMarc Mutz2023-07-121-2/+2
| | | | | | | | | | | | | | This is the result of running util/normalize on the code base. The following manual edits were needed: - skipped the hits in IS_SIGNAL_CONNECTED, which is using function pointers under the hood - restored the space before * in Q_SIGNAL void foo(QType *arg) Pick-to: 6.6 Change-Id: I299b3747c1aa2f6b3bc5ae1794edeb6fadfd75c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Make qtdeclarative tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the follow script: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: Ibd12efab09ceb5852395e40f10b55fafb69c1b58 Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Retire the qt_parse_all_argumentsAmir Masoud Abdol2023-01-201-3/+3
| | | | | | Task-number: QTBUG-99238 Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove "2" from Qt Quick Controls directoriesMitch Curtis2022-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick Controls 2 was named that way because it was a follow-up to Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer supported, we don't need to have "2" in the name. Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. By doing this renaming a few weeks before feature freeze, it won't affect the release but still results in as little time possible spent manually fixing conflicts in cherry-picks from non-LTS releases as a result of the renaming. This patch does the following: - Renames directories. - Adapts CMakeLists.txt and other files to account for the new paths. A follow-up patch will handle documentation. It does not touch library names or other user-facing stuff, as that will have to be done in Qt 7. Task-number: QTBUG-95413 Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-2/+2
| | | | | | | | | | | | | | 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. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-16/+16
| | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-071-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: Id89ed14990804a5024183e75382cc539d4293da1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-081-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-115-234/+10
| | | | | | | | | | | | 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. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtQuickTest: add API for checking for polish at window levelMitch Curtis2022-06-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a qIsPolishScheduled(QQuickWindow *) overload of qIsPolishScheduled(QQuickItem *) (added in 40d6072bc8a4df0fe1a16025fe30fe653463a446) and deprecates qWaitForItemPolished() (added in 7a3cad0619662b992154e075ec6b840bfc8a46a7) in favor of qWaitForPolish(), which has QQuickItem* and QQuickWindow* overloads. The existing functions that take QQuickItem are useful, but testing Qt Quick applications can be made even easier by allowing users to check if a window has any items that need to be polished. This information is already present (in QQuickWindowPrivate::itemsToPolish), so it's very efficient to check for. This is especially useful now that Qt Quick Layouts using polishing for their layouting, for example, as it's no longer necessary to find individual polishable items in complex hierarchies before proceeding to interact with child items. [ChangeLog][QtQuickTest][QQuickTest] Added QQuickTest::qIsPolishScheduled(QQuickWindow *) and QQuickTest::qWaitForPolish(QQuickWindow *) functions for verifying that updatePolish() was called on one or more items managed by a window. [ChangeLog][QtQuickTest][QQuickTest] Deprecated QQuickTest::qWaitForItemPolished(QQuickItem *). Use the new QQuickTest::qWaitForPolish(QQuickItem *) function instead. Fixes: QTBUG-93757 Change-Id: I95b6e051b3c9fd2fa93604f4d9ccda486bb29f9d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix flaky tst_QQuickFolderDialogImpl::goUp testMitch Curtis2022-04-122-4/+1
| | | | | | | | | | | Don't listen to folderDialogListView's currentIndexChanged signal while setting its currentIndex, because the file associated with the delegate is not correct at that stage. Fixes: QTBUG-102415 Change-Id: I309c993742d29d23290af297c2a91c9c31d23a0e Pick-to: 6.2 6.3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Blacklist tst_QQuickFolderDialogImpl::goUp()Tor Arne Vestbø2022-04-081-0/+3
| | | | | | | Task-number: QTBUG-102415 Pick-to: 6.2 6.3 Change-Id: Ia78fc353a86bebbfb5319c38084e384a6c898c33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename android_dummy_imports.qml to dummy_imports.qmlAssam Boudjelthia2022-03-051-1/+1
| | | | | | | | | | | | | | | | Amends 16f0d38d568b3af135f5db862f5868a6bc669c42. From 0fc8a511baa6493c8d80046dd99b8eba3634d2a2, it seems that not only Android is relying on these imports to satify qmlimportscanner, but also Integrity. So rename the imports to something generic and remove the explicit mention for Android. Pick-to: 6.2 6.3 Task-number: QTBUG-97056 Change-Id: I9273fd0f9201a805cad4d588847796f7daecb686 Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Android: unify the android tests dummy import filesAssam Boudjelthia2022-03-022-6/+10
| | | | | | | | | | | | | This renames all qml files added before to allow qmlimportsanner to include the necessary modules into Android packages, into android_dummy_imports.qml, and also adds a comment in each one describing why it's needed. Pick-to: 6.2 6.3 Task-number: QTBUG-97056 Change-Id: I7fc0514dd9e5bc10849fdd0503547e1a75242414 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Android: various test fixesAssam Boudjelthia2022-03-021-0/+6
| | | | | | | | | | 2nd round of test failures fixes for Android. Mostly resource bundling related issues still. Pick-to: 6.2 6.3 Task-number: QTBUG-97056 Change-Id: I2fac0710a7b5528fcef4480babd0cbf749e488b3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use up-to date LGPL license headerKai Köhne2022-01-271-11/+14
| | | | | | | | | | | Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3 instead of LICENSES.LGPL3. See also 5d4679289bc for a similar commit in the past. Pick-to: 6.3 Change-Id: Icbe5eea7bb7b9c5d46cdd56fa3b177d2e22a5fa9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Restructure Qt Quick Dialogs testsMitch Curtis2021-12-237-0/+1194
- Move contents of tests/auto/quickcontrols2/dialogs to tests/auto/quickdialogs. - Move tests/manual/quickcontrols2/dialogs to tests/manual/quickdialogs/dialogs. This makes the dialogs tests consistent with other modules that have their own "top-level" test directories. Fixes: QTBUG-99034 Pick-to: 6.2 6.3 Change-Id: I4ba155433507870fa607100af1b7957f8430727c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>