Commit Graph

15 Commits

Author SHA1 Message Date
Joerg Bornemann 4f57e20f25 CMake: Don't enable ASM language
Remove the ASM language where no assembler files are used.

Pick-to: 6.5 6.8 6.9
Change-Id: I3c94f798803b054a432fc2c8d6d65c665572a202
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-02 16:02:32 +02:00
Ivan Solovev 7fcdc34317 Fix resizing and moving of a Quick Dialog with popupType = Popup.Window
If the user moves the Dialog using the mouse, and then tries to resize
it (also using the mouse), they will observe two issues:
1. As soon as resizing was started, the dialog jumped to the coodrinate
   specified by the x and y properties. Depending on the OS, it could
   jump back after the resizing is finished (Windows), or stay at that
   position (macOS).
2. If the resizing is started in such a way, that topLeft coordinate is
   involved, it didn't actually change (apart from jumping as described
   in point 1), but instead the width and height were changed in an
   unintuitive way.

The first problem is caused by the fact that
QQuickPopupPositioner::reposition() method used x and y properties to
get the requested position. However, when the dialog is moved using
the mouse, only the effective position is updated.

The second problem is more involved.
When the user starts resizing from the topLeft corner, we end up in
QGuiApplicationPrivate::processGeometryChangeEvent(), which registers
that both resize and move events have happened. The code processes the
resize event first, so here's what happens:
1. The window geometry is updated (we'll use that fact later)
2. The resize event is generated and sent.
  2.1. This resize event triggers QQuickPopupWindow::resizeEvent(),
       which updates the popup item's width and height.
  2.2. Each of width and height updates calls geometryChange(), which
       ends up in QQuickPopup::geometryChange(). That, in turn, calls
       QQuickPopupPositioner::reposition().
  2.3. The reposition() call changes the position of the popupWindow
       using the current topLeft value. IIUC, this schedules another
       system geometry change event to the event loop.
3. After that we're back to QGuiApplicationPrivate, and generate the
   move event.
  3.1. This move event is handled in QQuickPopupWindow::moveEvent(),
       which simply updates the effective position (without moving
       anything).
4. After that we handle the move event from the reposition() call
   (the one that is generated at point 2.3). And here we update the
   effective position back to the old value.

To fix both issues, use the fact that the window's geometry is actually
updated at the very beginning (point 1 above), so we already know
the new topLeft when handling the resize event.
Use this value to temporary update x and y member variables (directly,
without touching the properties), before setting the width and height.
That means that the reposition() calls will use the proper top-left
position to do the positioning. Once we're done, restore the actual
x and y values, because they can differ from the effective pos.
The fix is sub-optimal, but seems to have the least possible impact
on other code (like normal Popup behavior or general geometry updates
handling).

Writing unit-tests for such case is not really possible, since the
testlib does not allow to simulate the interaction with the
non-client part of the window, so simply provide a manual test.

Fixes: QTBUG-130623
Pick-to: 6.8
Change-Id: I8209c8a648d95f3b83ae15a77b48bf04eeb1c154
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-11-06 10:00:07 +01:00
Lucie Gérard 9c5fc88388 Correct license for test files
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>
2024-02-27 10:32:21 +01:00
Santhosh Kumar 8d3ed392bb Update manual tests and examples for change in default size policy
The size policy of item updated as part of task QTBUG-117597. This
patch update existing examples and manual tests that depends on quick
layout to embrace size policy change.

Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: I68469a3bba3c4d3e5ed4b6eae0fd765b5206efc0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-02-21 14:27:54 +01:00
Fabio Falsini 2e44d316c8 Add flag to hide eye dropper button from qml ColorDialog
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>
2023-06-24 14:37:18 +02:00
Yuhang Zhao e7c1fec763 Move Settings out of Qt.labs module
Move Settings from the Qt.labs module to the QtCore module.
And deprecate the original one in Qt.labs.

Also changed the fileName(QString) property to location(QUrl)
to better fit the Qt API.

Adjust the tests accordingly.

Task-number: QTBUG-92806
Change-Id: I1cbad1315383a9f2963583fd4d00cf3612f99f1e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-29 21:31:17 +08:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
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>
2022-09-07 17:01:30 +02:00
Alexandru Croitor 93f8443c52 CMake: Rename tests to be unique for top-level builds
Pick-to: 6.4
Task-number: QTBUG-105238
Change-Id: I5037d942818d96b8f6cc474a81c56362df0fd01d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 22:05:37 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
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>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
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>
2022-06-11 08:05:15 +02:00
Mitch Curtis 8353f84141 FileDialog: make selectedFile writable
This allows setting an initially selected file.

[ChangeLog][QtQuickDialogs] FileDialog's selectedFile property
can now be set to an initially selected file.

Fixes: QTBUG-101975
Pick-to: 6.3
Change-Id: I399f9379e1ac54917edbc31f9029d5522a914340
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-06-02 12:46:11 +08:00
Oliver Eftevaag 1234a59a4d Add ColorDialog to QtQuick.Dialogs
[ChangeLog][QtQuickDialogs] Added ColorDialog.
This is a native dialog on platforms that support it,
and a non-native Qt Quick ColorDialog on platforms that don't.

The supported styles are Basic, Fusion, Imagine, Material
and Universal.

Fixes: QTBUG-87796
Change-Id: I7146ca0571c84c9878a4010798e083ee249f273c
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-05-31 17:23:08 +02:00
Mitch Curtis 727b2d3b6d dialogs: move accept label next to reject label
Change-Id: I40113f6d71fac0aed0ea2438c3f582bc6dcffe19
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-12-23 18:42:59 +01:00
Mitch Curtis 2dc1080f5f Restructure Qt Quick Dialogs tests
- 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>
2021-12-23 13:16:38 +01:00