aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickdialogs/quickdialogsquickimpl
Commit message (Collapse)AuthorAgeFilesLines
...
* Quick Dialogs: Opt out of QTP0004Fabian Kosmale2024-07-091-0/+3
| | | | | | | | | | | | | | | | This silences the CMake warning about using the old behavior of the policy. We however don't want the additional qmldirs, as that seem to cause name clashes (we have QML types with the same names as C++ types in QtQuick.Dialogs and QtQuick.Dialogs.quickimpl; consequently the import order really matters). Opting in to the policy can be addressed in the refactoring that should be done as part of QTBUG-104091. Task-number: QTBUG-126201 Pick-to: 6.8 Change-Id: I461c675435df070db17b4cb930fae0de9a7edf3d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQuick: Make more logging categories static #2Kaj Grönholm2024-06-253-3/+3
| | | | | | | | | Non-static, non-forward-declared logging categories are deprecated. Task-number: QTBUG-67692 Change-Id: Ie8f09c4a362913cc1609fb062ade89a8b83d63c8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Make more logging categories staticUlf Hermann2024-06-246-19/+19
| | | | | | | Non-static, non-forward-declared logging categories are deprecated. Change-Id: Iaeb0183ef7ca05bbd0f4587166096c29825cc175 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the use of GENERATE_CPP_EXPORTS argumentAlexey Edelev2024-06-111-1/+0
| | | | | | | | | The behavior that argument was enabling is the default one now. Pick-to: 6.8 Task-number: QTBUG-90492 Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix top padding in Material style textareaSami Varanka2024-04-172-0/+4
| | | | | | | | | | | Material and Universal style MessageDialog didn't set implicit width and height for the TextArea's background. This caused problems especially with material style's messagedialog where the detailed text went over the TextArea's background's bounds. Pick-to: 6.6 6.7 Fixes: QTBUG-123763 Change-Id: Ib318f4a514a1b0941b4d50d960b383aca27e5d9f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Correct license for module and plugin fileLucie Gérard2024-04-091-1/+1
| | | | | | | | | | | | | | | | | | According to QUIP-18 [1], all module and plugin files should be LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only or LicenseRef-Qt-Commercial OR GPL-3.0-only Also, LGPL and non LGPL should not be mixed in a given directory [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I812452a951b38cd3937a66314c457e3e361e63e9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Dialogs: Dont import Controls.impl into namespace identifierOliver Eftevaag2024-04-052-2/+2
| | | | | | | | | | | | | | | QQuickColor exists in the QtQuick.Controls.impl module, which were imported using the as <Qualifier> syntax. But references to the Color singleton didn't append the namespace identifier, which caused the Basic style FileDialog to print annoying warning messages. It turns out that the namespace identifer could just be omitted. Pick-to: 6.7 Change-Id: I2ba8df5d7dab730b52fdad417e96f3787f2d1989 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Dialogs: Pass fileSize as double rather than stringUlf Hermann2024-02-296-6/+11
| | | | | | | | | | | | | | | Passing it as string gives the illusion of greater accuracy. However, the string is coerced to double again when calling formattedDataSize(). Therefore the accuracy is indeed an illusion. Admit to the limited accuracy and range-check the number. 9PB should be enough for everyone. Pick-to: 6.7 Change-Id: If0ce5a762dce0b1df35ccb57af87d87719750786 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Dialogs: Depend on controls styles in QuickDialogs2QuickImplUlf Hermann2024-02-091-4/+22
| | | | | | | | | | | This forces them to be built before, making their qmltypes available to the subsequent build steps. Having the styles as linkable backing libraries also makes their C++ types available to qmlsc's direct mode. Pick-to: 6.7 6.6 Task-number: QTBUG-121643 Change-Id: I24688b325d27f16e7cc77219cf481b3b30ca52a3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the use of GENERATE_PRIVATE_CPP_EXPORTSAlexey Edelev2024-01-111-2/+1
| | | | | | | Task-number: QTBUG-117983 Change-Id: I584116bfd4d47deca914910b712c2ea3295f3e7f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* FileDialog: set url schema when using the file name text fieldOliver Eftevaag2024-01-101-1/+4
| | | | | | | | | | | | | | | | When using the text field to choose a file name inside the non-native file dialog, the selectedFile property would be updated based on the currentFolder property and what the newly typed filename was. However, the schema was ignored. This patch fixes the issue by also setting the schema in QQuickFileDialogImpl::setFileName(const QString &fileName). Fixes: QTBUG-120065 Pick-to: 6.7 6.6 6.5 Change-Id: I1860fbbc8209270d0bc6e34a4be6a91bad2253ab Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Remove the use of Q_QUICKDIALOGS2QUICKIMPL_PRIVATE_EXPORTAlexey Edelev2024-01-0919-24/+24
| | | | | | Task-number: QTBUG-117983 Change-Id: I3a5f4d2dceb2399e89655d3789cf6cb3fbe5815e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Only update the filename text field when the user selects a fileOliver Eftevaag2024-01-097-5/+15
| | | | | | | | | | | | | | | | | Apparently, it's normal for file dialogs to not update the text field that represents the filename of the currently selected file, if the selected file is a directory. To achieve that behavior, I'm removing the binding on the text property, and instead call setText() to update the text field when either the user selects another file in the file dialog list view, or when the selectedFile is changed externally. But only if the selectedFile is an actual real file, and not a directory. Fixes: QTBUG-119917 Pick-to: 6.7 6.6 6.5 Change-Id: I8dbf41ba403d09419a2d66130bdad59e66c9d1cf Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* FileDialog: prompt the user when selecting an existing fileOliver Eftevaag2023-12-229-4/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is common for editing software to prompt the user when he/she wishes to save the work done in the editor, and an existing file is selected in the file dialog. This is an extra safety step, to hopefully prevent the user from accidentally shooting himself/herself in the foot, by overwriting an existing file and losing something valuable. One of the available file dialog option is DontConfirmOverwrite. Which according to the documentation, could be set in order to bypass a confirmation which is supposed to show up by default. But that weren't the case when using the non-native quick file dialog. The FileDialog will now show that confirmation dialog as a popup dialog, which popups up on top of the FileDialog, when selecting an existing file using the SaveFile file mode. The DontConfirmOverwrite option can now be used as intended, which will make the FileDialog behave like it used to, when selecting an existing file. In additon, hitting enter while the file dialog list view has focus, will now function the same as clicking the "Open" button. This was done in order to prevent the user from being able to bypass the new confirmation dialog. Fixes: QTBUG-119916 Pick-to: 6.7 6.6 6.5 Change-Id: I07710a7126c53f489fd5554ea21e7684244a93c1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* FileDialog: improve keyboard navigation for all stylesOliver Eftevaag2023-12-155-2/+11
| | | | | | | | | | | | | | | Tab navigation between the file dialog list view, breadcrumbbar and name filters combobox wasn't implemented on all styles. Furthermore, the file name text field were not present in the tab focus chain at all, regardless of the FileDialog's fileMode. This patch fixes tab navigation for every style, and brings the file name text field into the tab focus chain when fileMode == SaveFile. Pick-to: 6.7 6.6 6.5 Change-Id: Ie94d694449d545491c1198ec9b4594d8d475a210 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Check if QQuickFileDialogImplPrivate::options is null before derefEirik Aavitsland2023-12-141-2/+3
| | | | | | | | | | A recent fix introduced an unchecked deref of d->options. No problem has been observed, but all other usages in this file are guarded, so avoid introducing a potential crash. Pick-to: 6.7 6.6 6.5 Change-Id: I3602808c42094d24ba08d32612af3d3e95e90279 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* MessageDialog: make QQuickAbstractDialog::result return button pressedOliver Eftevaag2023-12-101-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The widgets QMessageBox returns either the StandardButton value of the last button pressed, or the index, in the case of custom buttons. This differs from how we did things in quick, where we'd always return either 0 or 1 (Accepted or Rejected). The documentation even states the following: MessageDialog sets the result to the value of the clicked standard button instead of using the standard result codes Which was incorrect, since the result property functioned the same, regardless of dialog type. The goal of this patch is to make the result property for MessageDialog behave the same as QMessageBox, without changing the behavior for other dialog types. In order to accomplish this, the type has to be changed from StandardCode to int, since the result value can either be a StandardCode value, or a StandardButton value. The widget QMessageBox also differs in that it will not emit rejected when the user presses a button with a role that isn't NoRole or RejectRole. I've decided to make the MessageDialog behave the same way. [ChangeLog][QtQuick][Dialogs][Important Behavior Changes] The MessageDialog will no longer emit rejected when the user presses a button that doesn't have the role NoRole or RejectedRole. Task-number: QTBUG-118445 Task-number: QTBUG-118689 Task-number: QTBUG-118212 Change-Id: I7084a889210027f5c057f5c22eee2e08867ce741 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Use the PlatformServiceColorPicker for the ColorDialog's eye dropperOliver Eftevaag2023-12-081-3/+20
| | | | | | | | | | | | | | | | | On wayland, it's not possible to use QScreen::grabWindow(), in order to to pick a color from the screen. However, it is possible to use the XDG desktop portal, to pick a color for us. In qtbase the commit 00a8957cef8f9406346d299da03f595427078f43 added a new virtual function pickColor() to QPlatformService. This patch takes advantage of this new API, to prioritize using this new platform service if available, and fallback to the old behavior in case it's not supported for the current platform. Change-Id: Ia155531ff4e6ee1446f122dcb44d90753c11846b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QML FileDialog file size overflowJonas Karlsson2023-11-265-5/+5
| | | | | | | | | | Since an int is too small to store the file size we use a string instead. Fixes: QTBUG-119005 Pick-to: 6.6 6.5 Change-Id: I9b9a8724e8a1ca26b482396fb8a62aab206898cf Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Remove all QML_DECLARE_TYPE from src and toolsUlf Hermann2023-11-188-16/+0
| | | | | | | | They are generally not useful for anything. Change-Id: I12e959ce9338e6eb7465633496c7921fa09a3fe8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add license headers to shader sourceEskil Abrahamsen Blomfeldt2023-10-301-0/+3
| | | | | | Pick-to: 5.15 6.2 6.5 6.6 Change-Id: I007eaddf0a3a9e7e6242d4e02b487fa0806c96a7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Include what you need: <QPointer>Marc Mutz2023-10-066-0/+12
| | | | | | | | | | | | | | | | | | | | | | | All these TUs relied on transitive includes of qpointer.h, maybe to a large extent via qevent.h, though, given that qevent.h is more or less the only public QtBase header that includes qpointer.h, something else seems to be at play here. Said qevent.h actually needs QPointer in-name-only, so a forward declaration would suffice. Prepare for qevent.h dropping the include. The algorithm I used was: If the TU mentions 'passiveGrabbers', the name of the QEvent function that returns QPointers, and the TU doesn't have qpointer.h included explicitly, include it. That may produce False Positives, but better safe than sorry. Otherwise, in src/, add an include to all source and header files which mention QPointer. Exception: if foo.h of a foo.cpp already includes it, don't include again. Task-number: QTBUG-117670 Change-Id: I9b98cda524a0e6a61be7805edda708916bb2bc2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix accept button enabled state in non-native file dialogEirik Aavitsland2023-09-212-7/+23
| | | | | | | | | | | | | | | | When editing save file name in the line edit, and changing it from empty to non-empty or the other way around, the accept (Save) button would not be enabled/disabled accordingly. Can be tested with the qml file from the linked task. Task-number: QTBUG-101552 Task-number: QTBUG-108455 Pick-to: 6.6 Change-Id: Icc0ea5f68cfe06e95f54839cf4bd930bd8d57daf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Fix default button label for non-native file dialog in SaveFile modeEirik Aavitsland2023-09-211-1/+3
| | | | | | | | | It would use the OpenFile label independently of actual mode. Fixes: QTBUG-105080 Pick-to: 6.6 Change-Id: Ia529f6854dd676197af99cbe0a610f5833181ce2 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Add flag to hide eye dropper button from qml ColorDialogFabio Falsini2023-06-246-1/+13
| | | | | | | | | | | | | In devices with small screen like smartphone the ColorDialog dialog covers almost the entire screen so the eye dropper button doesn't make much sense and risks confusing the user. This patch add a flag to hide the button. Also if both title and button are not showed the header is resized to a fixed height. [ChangeLog][Dialogs][ColorDialog] Added a NoEyeDropperButton option to hide the eye dropper button Change-Id: I89f740b254a8f9d4a1274a2624d1b9b5da648184 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* ColorDialog don't resize correctly on small screensFabio Falsini2023-05-225-5/+5
| | | | | | | | | | | | The SaturationLightnessPicker control is set to always have a square shape but in this way when the screen height is not sufficient (as in the case of smartphones) the dialog does not fit going beyond the edges of the screen and became unusable Change-Id: I9b04286dd744c70ba0f4d27d85b0ef398f685b43 Fixes: QTBUG-113673 Pick-to: 6.5 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Fix build with -no-feature-qml-delegate-modelTasuku Suzuki2023-05-011-1/+0
| | | | | Change-Id: I5c4d7df079346e9750b521e19bff3f34b6c81306 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build with -no-feature-listview and itemviewsTasuku Suzuki2023-04-132-20/+29
| | | | | | | | | | | | | tested with each/all of below -no-feature-gridview -no-feature-listview -no-feature-pathview -no-feature-tableview -no-feature-treeview Pick-to: 6.5 Change-Id: I90cc7bc45bb9065000bc0fc7eeb8e80f02acb0d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QuickDialogs: Add QtQuick.Layouts as dependencyUlf Hermann2023-02-211-0/+1
| | | | | | | | | | | This doesn't teach qmlimportscanner to understand dependencies, but it definitely isn't wrong. Pick-to: 6.5 Task-number: QTBUG-111187 Change-Id: Ib252930b4423b6900a79e414f7a4ea15086619ea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQuickTemplates: Disambiguate static string constantsFriedemann Kleint2023-02-101-5/+0
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I2f1b6a7421f66d3d731d5a273242c2b27a882354 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build with -no-feature-validatorTasuku Suzuki2023-01-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By removing property, getter, setter and notify signal for validator. .../qmetatype.h: In instantiation of ‘constexpr bool QtPrivate::checkTypeIsSuitableForMetaType() [with X = QValidator*]’: .../qmetatype.h:2589:9: required from ‘constexpr const QtPrivate::QMetaTypeInterface* QtPrivate::qTryMetaTypeInterfaceForType() [with Unique = void; TypeCompletePair = QtPrivate::TypeAndForceComplete<QValidator*, std::integral_constant<bool, true> >]’ .../qmetatype.h:2639:102: required from ‘constexpr const QtPrivate::QMetaTypeInterface* const qt_metaTypeArray [72]<int, QVariant, QQmlInstanceModel*, bool, int, int, QString, QString, QString, QQmlComponent*, QQuickItem*, QQuickPopup*, bool, bool, bool, QString, QValidator*, QFlags<Qt::InputMethodHint>, bool, bool, double, double, QVariant, QString, bool, QQuickComboBox::ImplicitContentWidthPolicy, QQuickComboBox, void, int, void, int, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, void, QString, int, int, const QString&, QFlags<Qt::MatchFlag>, int, const QString&, QVariant, int, int, const QVariant&>’ .../moc_qquickcombobox_p.cpp:588:5: required from here .../qmetatype.h:1181:55: error: static assertion failed: Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *) Pick-to: 6.5 Change-Id: I0ee5ae9c84bc977571f39788299f1d84a7e582c5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build with -no-feature-shortcutTasuku Suzuki2023-01-172-1/+10
| | | | | | Pick-to: 6.5 Change-Id: Ic62efb7a7e6f79920121f99f0d8b74eaaa3b7d4a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix build with -no-feature-cursorTasuku Suzuki2023-01-171-0/+4
| | | | | | Pick-to: 6.5 Change-Id: Ibb89885c6cde3e49fffbc02f9c83880f2f2dda5d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Remove "2" from Qt Quick Controls directoriesMitch Curtis2022-12-01165-0/+14893
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>