Commit Graph

37 Commits

Author SHA1 Message Date
Mitch Curtis a318e6f354 Replace currentFile(s) with selectedFile(s)
selectedFile can represent the currently-selected file (if the platform
supports it), and so we can free up "currentFolder" for FolderDialog
now that it means the folder that is being displayed, rather than the
folder that is currently selected.

[ChangeLog][QtQuickDialogs] FileDialog's currentFile and currentFiles
properties have been deprecated. The selectedFile and selectedFiles
properties now refer to the currently selected file(s), as well
as the final selection.

Fixes: QTBUG-98562
Task-number: QTBUG-87798
Change-Id: Ic66481332338f21169a9f63617cf4db4be83265d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 13399bd54d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-01-05 21:23:20 +00:00
Mitch Curtis b592f32f41 FolderDialog: undocument ShowDirsOnly option
This option doesn't make sense for FolderDialog, and was likely an
oversight in the original Qt.labs.platform version.

Task-number: QTBUG-87798
Change-Id: Ia97b6d208ec9344f071a93e36387de804cddb283
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit dbf207116e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-23 00:27:27 +00:00
Mitch Curtis 8a7f3aab6e Doc: fix detailed description that mentions selected/currentFolder
It was documenting the old behavior.

Task-number: QTBUG-87798
Change-Id: I2ba3ce1e10b777d8b1e18a8d7f2553cd47ff5a53
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 080c848491)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-23 00:27:20 +00:00
Mitch Curtis df6468517e QQuickFolderDialogImpl: remove attached buttonBox property
Unlike FileDialog, which requires name filters to be in the footer
alongside the DialogButtonBox, FolderDialog only has one item in its
footer: DialogButtonBox. Simplify the code (and also avoid calling
some signal-connected functions twice) by removing this attached
property and let QQuickDialog take care of the plumbing.

Task-number: QTBUG-87798
Change-Id: I68e83732a551b21b974de5c4e1b419030c6c9740
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit fb580219e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-22 20:00:09 +00:00
Andrei Golubev 66a7192768 CMake: Attempt to fix QNX tests linking when cross-compiling
Amends 7d22d32dc0

We need to apply the same idea to QuickDialogs2QuickImpl it seems

Task-number: QTBUG-86533
Pick-to: 6.2 dev
Change-Id: Ib7d11c196659aa16ab7a8cda1a199c6b1c7179f9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-12-21 10:45:52 +00:00
Mitch Curtis 5963aba091 Implement remaining non-native FolderDialog styles
While we're at it, correct the values of some properties
we're setting on FolderListModel.

Task-number: QTBUG-87798
Change-Id: I61d40c84e6ee8784cb2c27f90b6aaffc9976311c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 7dcffc2e54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-19 08:39:03 +00:00
Alexandru Croitor 7d22d32dc0 CMake: Fix QNX tests to link when cross-compiling
Apparently CMake does not consider link dependencies brought via
INTERFACE_LINK_LIBRARIES as implicit dependencies to be added to
IMPORTED_LINK_DEPENDENT_LIBRARIES.

This means CMake won't add an -rpath-link flag when we expect it to,
leading to some tests failing to link when cross-compiling.

Until we figure out if our assumption is wrong or it's a bug in CMake,
fix the issue by linking explicitly to a few more dependencies
and thus force the addition of those dependencies to the
IMPORTED_LINK_DEPENDENT_LIBRARIES property of the generated
QtFooTargets.cmake files.

The issue was always there, but it got triggered recently in the CI
because 701294e3624fd76db2e71c2f620feafc59bda350 landed in qtbase
in conjunction with a submodule dependency update.

Task-number: QTBUG-86533
Fixes: QTBUG-99275
Change-Id: I89a87c6cca5d7ae6c04e7f672ee606444452391a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7d8f0ade0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-17 22:48:16 +00:00
Topi Reinio 39433310aa Doc: Fix documentation warnings
qquickfiledialog.cpp:
  * Can't link to '[QtCoreQml]StandardPaths'

qquickfolderdialog.cpp:
  * Can't link to 'folder

qquickmessagedialog.cpp:
  * Undocumented parameter 'button' in MessageDialog::buttonClicked()
  * Undocumented parameter 'role' in MessageDialog::buttonClicked()

qquicktreeviewdelegate.cpp:
  * Can't link to 'QQuickItem::x position'
  * Can't link to 'QQuickControl::rightMargin'
  * Can't link to 'indicator'

qquicktreeview.cpp
  * Unknown macro 'c'

Change-Id: I717030b5be45e716b719aa9a59fe7d7a47f11ddb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 52402e6522)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-12-17 14:39:09 +00:00
Mitch Curtis 5ba0e82297 Add FolderDialog
[ChangeLog][QtQuickDialogs] Added FolderDialog. This is a native
FolderDialog on platforms that support it, and a non-native
Qt Quick FolderDialog on platforms that don't.

Task-number: QTBUG-87798
Change-Id: I95d872f450b528e54dd26f5421b6c5a4b71a9bc3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-12-10 23:36:44 +01:00
Oliver Eftevaag d4d56b519d Deprecate QQuickFontDialog::currentFont
[ChangeLog][QtQuickDialogs] To make the font dialog's API consistent with the file and folder
dialog, we're deprecating the "currentFont" property and replacing it
with the "selectedFont" property, which previously was used as the final
selection made by the user.
By the time the user accepts the dialog, the currentFont and
selectedFont had the same value anyways. So if the application needs to
react "live" to which font the user is selecting, they can now simply
bind to the selectedFont property, and if the application only wants to
update a font when the user accepts the dialog, they can handle the
accepted signal, and read from the selectedFont property in the signal
handler.

Fixes: QTBUG-98563
Change-Id: I744bb421a466748d41e5e9c6fd6978c45601984c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-12-10 17:10:11 +01:00
Oliver Eftevaag 1b4800e7c0 Add MessageDialog to QtQuick.Dialogs
[ChangeLog][QtQuickDialogs] Added MessageDialog. This is a native
MessageDialog on platforms that support it, and a non-native
Qt Quick MessageDialog on platforms that don't.

Fixes: QTBUG-87800
Change-Id: I5e7c7afb0bfeb1c84b67f36712b0ed2d5df75ecb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-12-09 23:16:37 +01:00
Kai Köhne 5d4679289b Use up-to date LGPL license header
Remove usages of outdated LGPL3 header that references LICENSES.LGPLv3
instead of LICENSES.LGPL3.

Change-Id: If7a90ec18331a68491c5a740f131a5e7b3f37df4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-11-29 09:21:34 +01:00
Thiago Macieira dd75ee4fce Move Q_DECLARE_PUBLIC to the public section
This is now required to use QObjectPrivate::connect.

Change-Id: Iccb47e5527544b6fbd75fffd16b8bd87f0818ad5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2021-11-27 19:08:07 -08:00
Mitch Curtis e26427264e FileDialog: sort case-insensitively
This matches what Windows, macOS, and Linux do.

Fixes: QTBUG-73633
Pick-to: 6.2
Change-Id: Ibf20acda17ab65b48599b3936bef7679375060d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-11-05 13:30:21 +02:00
Mitch Curtis 26f3b70119 FileDialog: show dirs first on non-macOS platforms
macOS shows files amongst directories instead of after them.

Change-Id: Ib21918611eed59936dccd694540bc426752729fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-11-05 13:30:21 +02:00
Oliver Eftevaag 3c15f90fc6 QuickFontDialog: make setCurrentFont() update listview indexes
For the non-native implementation of the QQuickFontDialog, when the qml
user assigns a new font to the currentFont property, the list view
indexes should be changed to point the family, style and pointSize of the
new font.

In cases where the family, style or size of the new font exists in
the model for the representing listview, the index for that listview should
be updated to the new value, or 0 if the value isn't found, or -1 if the model
is empty.

Fixes: QTBUG-96934
Pick-to: 6.2
Change-Id: Ia7bb11d01c4a0807d0df742f34bd8aefb00104f6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-11-02 19:37:04 +01:00
Alexey Edelev 250d6269e9 Migrate to autogenerated cpp exports
Replace the hardcoded cpp exports with a generated one where it's
applicable.

Task-number: QTBUG-90492
Change-Id: I4af021bf828e05c8d6f3f975befd3b6b2cf63462
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-02 16:32:25 +01:00
Ivan Tkachenko a155e32037 Doc: Replace \qmlproperty Object and list<> thereof with QtObject
And in case of QtQuick.Controls::Popup::anchors.centerIn it was an Item.

Change-Id: I2ad7ac6969b729711138390de4efe8d6509dcc5e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-10-22 00:07:55 +03:00
Giuseppe D'Angelo fa3b9767c5 Fix the implicit capture of `this` in lambdas when capturing [=]
C++20 deprecated the implicit capture of `this` when a lambda just
captures [=], so we must stop relying on that. Adding `this` to such
a capture list works in C++20, but it's illegal in C++17 (d'oh).

Hence, turn these captures into capturing (by value) what they need.

Pick-to: 6.2
Change-Id: I67fc1572b68dec9d3bdb78da3e03471970b9ce12
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-09 15:38:25 +02:00
Oliver Eftevaag c96c49bced QQuickFontDialogImpl: Fix ValueType error
Referencing GroupBox by id rather than by parent.

Pick-to: 6.2
Change-Id: Idf5eb767539074e070a4c20336bcfa26b4e480a6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-10-07 18:02:44 +02:00
Mitch Curtis d000649cb7 QQuickFileDialogImpl: fix issues with breadcrumb bar text edit
- Always set the text edit's text to the current directory, not the
  selected file. This matches the expected behavior of a file dialog.
- Fix an issue where the text edit's visibility was toggled twice,
  resulting in it showing up on top of the breadcrumbs when it
  shouldn't.

The latter issue was found while fixing the former, and they are
both tested by the same auto test.

Change-Id: I8f1420ec9edaba1e33f1d1a268567a45d63d76b5
Pick-to: 6.2
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-10-06 11:37:03 +02:00
Kai Köhne 9fe33048e1 Doc: Mention that QtQuick.Dialogs was added in Qt 6.2
Pick-to: 6.2
Change-Id: I6b0f75a097a8c5be5e0e1c66585287c8157d5529
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-09-17 16:43:22 +02:00
Kai Köhne 76996fc183 Doc: Remove unsupported customFilters
customFilters defined in .qdocconf are not supported anymore by Qt
Assistant since Qt 5.13. Therefore remove them from all .qdocconf files,
also to avoid cargo-culting them to new help modules.

Task-number: QTBUG-95987
Change-Id: Id17e9c73093aea87d66d13454cbfe9172916fb37
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-08-31 16:33:03 +00:00
Topi Reinio 13c5c8e09e Doc: Fix remaining documentation warnings
* Refer to correct types in Window QML type docs.
* Fix link target for 'Required properties'.
* Fix other minor issues.

Pick-to: 6.2
Task-number: QTBUG-95860
Change-Id: Icc2819a18ad8cfc44d39f13b22c595ed7b2f0806
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-08-31 09:21:30 +02:00
Mitch Curtis 7ff08e04de Rename QQuickFileNameFilterForeign to avoid potential build issues
An error was reported for static builds:

[...]libQt6QuickDialogs2QuickImpl.a(mocs_compilation.cpp.o):(.data.rel.ro.local._ZN27QQuickFileNameFilterForeign16staticMetaObjectE+0x0): multiple definition of `QQuickFileNameFilterForeign::staticMetaObject'; [...]libQt6QuickDialogs2.a(mocs_compilation.cpp.o):(.data.rel.ro.local._ZN27QQuickFileNameFilterForeign16staticMetaObjectE+0x0): first defined here

This patch attempts to fix it by giving each foreign struct a different
name.

Pick-to: 6.2
Change-Id: I1b859ad1ec7b0ce82b40a1fa5a74ceb219841bf3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-13 12:34:37 +02:00
Kai Köhne 45fabae0d0 Doc: Add QtQuick.Dialogs landing pages
Create minimal landing pages for the QtQuick.Dialogs module.

Fixes: QTBUG-94964
Pick-to: 6.2
Change-Id: Id354131d500de8cf36d6345f1b68fc7eca26c71e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-08-12 07:48:33 +02:00
Alexandru Croitor 131682ec7d CMake: Fix controls packages to have correct Qt package dependencies
The Qt6QuickControls2 package did not get a Dependencies.cmake file
generated to call find_package(Qt6Quick) because Quick was removed
from the PUBLIC_LIBRARIES section of the Qt module definition.

Same for the other controls Qt modules and their dependencies.

Those were incorrectly removed with the idea that they were plugin
targets which don't have public dependencies, but that's not the case,
they are Qt modules, not plugins.

Restore the public library dependencies, so that transitive
find_package'ing works.

Amends 9c30798a43

Pick-to: 6.2
Fixes: QTBUG-95532
Change-Id: Ie2cb69cdde5585e90a5ce97a6d3666a647daef40
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-02 23:27:24 +02:00
Oliver Eftevaag ef9e58808c QQuickFontDialog: Minor visual adjustments for universal and material
These changes are subjective, and might not be seen as an improvement by
everyone.

Personally, I felt that some space could be removed between the text
fields and list views for the material style, and between the list
views and group boxes for the universal style.

Task-number: QTBUG-87799
Pick-to: 6.2
Change-Id: I2a94caaa2304ccef0c9709bbfe9a0cd9b56e2034
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-07-19 10:53:37 +02:00
Ulf Hermann fd2a2808ac Remove unnecessary type registrtion function declarations
For auto-generated plugins we don't need the declarations.

Pick-to: 6.2
Change-Id: I0250703e7c81debc6bc6ca526722c43b8a8058c8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-07-16 23:37:01 +02:00
Mitch Curtis e2f4afcedb Improve visuals of non-native FontDialogs
- Specify preferredHeights directly on the items that need them rather
  than doing it at a higher level. This makes the lower row with the
  text edits and check boxes shorter, giving more space to the row with
  the list views.
- Convert the ColumnLayout containing the check boxes into a RowLayout
  to save vertical space.
- Add some spacing and padding where necessary now that everything is
  more compressed.

Task-number: QTBUG-87799
Pick-to: 6.2
Change-Id: Iba288f678c1d449ace3bc143073d216fe69d9d9a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-07-14 11:40:30 +02:00
Joerg Bornemann 9c30798a43 CMake: Don't give plugins PUBLIC usage requirements
The pro2cmake.py conversion script faithfully reproduced the .pro files
for the plugins, which specified the libraries as public. But in CMake,
the implications of this are that public usage requirements should then
be propagated to consumers. We don't expect any consumers, since a
plugin is created as a MODULE library in CMake, so for Windows we don't
even have an import library to link with. The only exception to this is
for static builds where plugins are created as STATIC libraries
instead, but only in certain controlled situations do we then link to
plugins. Even then, usage requirements are not expected to propagate to
the consumers, so these relationships should always be specified as
private.

As a drive-by fix, remove Qt::Foo dependencies that are already implied
by Qt::FooPrivate.

Pick-to: 6.2
Task-number: QTBUG-90819
Change-Id: I3f33766612367520e09e599f03ac06d43613aa81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-07-09 10:58:22 +02:00
Fabian Kosmale 2a4ff847e8 Adjust to QQuickItemPrivate::{width,height}Valid becoming a function
Task-number: QTBUG-94703
Pick-to: 6.2
Change-Id: I2c48f1cc94b8dd94cddab1d833f62299d35fe5d9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-07-07 23:35:17 +03:00
Oliver Eftevaag 74ab735615 Update copyright header to refer to Qt Quick Dialogs
The source files in Qt Quick Dialogs should now have a copyright header
that mentions they are indeed a part of the Qt Quick Dialogs module.

Pick-to: 6.2
Change-Id: I855edbca61f8e5c2a08dea50b5c70f1cdb3f996f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-06-09 07:47:34 +00:00
Craig Scott 5e8feb64d6 Update to latest qml CMake API
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>
2021-06-05 12:52:00 +02:00
Oliver Eftevaag c830979fbb Add FontDialog to QtQuick.Dialogs
Adding non-native FontDialog to QtQuick.
This is a native FontDialog on platforms
that support it, and a non-native
Qt Quick FontDialog on platforms that don't.

Fixes: QTBUG-87799
Change-Id: I43a59e3668a8a40f1d0c04a3c2506283d552a22b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-06-04 18:02:30 +02:00
Craig Scott d8949dffc5 Fix typo in exported declaration of qml_register_types... function
This prevented the function from being exported if something actually
tried to use it. At the moment, no other file is including the affected
header (that is a separate bug in qmltyperegistrar), which is why the
build wasn't failing despite the typo.

Change-Id: Ia9b266c4f5a42326932344e49bea228fd36ebb65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2021-05-31 18:23:20 +10:00
Mitch Curtis f9421abbdf Add QtQuick.Dialogs
[ChangeLog][QtQuickDialogs] Added FileDialog. This is a native
FileDialog on platforms that support it, and a non-native
Qt Quick FileDialog on platforms that don't.

Fixes: QTBUG-87797
Change-Id: Ia3a98b616479b818c96c232a0329750023079642
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-27 17:34:11 +02:00