Commit Graph

55 Commits

Author SHA1 Message Date
Lucie Gérard ed6afe6ae0 Correct license for tests file
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.8
Task-number: QTBUG-121787
Change-Id: I50964da74d6360bb88fc468765f6362ad39d20d1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-06-27 09:17:10 +02:00
Richard Moe Gustavsen 4c1174938c menus manual test: add SubSub menus
Its nice to be able to test that you can still
e.g hover the root menu, even when a subsub menu
is the active popup.

Pick-to: 6.8
Change-Id: Ibf76770a13c41f4712187daeb793439c83730db9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-06-21 11:45:40 +02:00
Richard Moe Gustavsen d09570b489 Menus manual test: update popupType combobox
Update the manual test to reflect that we no longer
have a Popup.Default option. Also, after seeing some
warnings, add a popupType() function, to improve
type safety.

Pick-to: 6.8
Change-Id: I70c4a52d776522541251bb0b2ab260b735d49171
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-06-19 18:08:05 +02:00
Mitch Curtis da85aef9ba Fix a couple of issues in the testbench manual test
- Ensure lastSearchText is serialized when clearing text.
- Ensure that MenuItems are actually checkable.

Pick-to: 6.5 6.7 6.8
Change-Id: I51eed8b89777f79b1d86427adbd7952812f6883a
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2024-06-14 09:47:51 +08:00
Mitch Curtis 006bd9d7a2 testbench: add checkable ToolButton
Change-Id: I7e2ff1eda5884d1322636f29f428cd6a33559495
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-06-12 08:19:10 +08:00
Oliver Eftevaag 823026646c Replace AA_DontUsePopupWindows with Popup::popupType
The application attribute approach has some weaknesses which makes it
less suitable, than simply having a property which can be set per
instance of Popup. In addition, given just how many of our own tests
that are failing, when changing the default behavior of popup, it`s a
much safer approach to introduce this feature as an opt-in, in the
beginning. We can instead potentially modify the behavior of
PopupType::Default in the future, when we feel that it's less risky
to do so.

To give more context to why the AA approach is bad:
- The AA is too grandiose of a solution, which adds an arbitrary
  limitation of not allowing mixing of in-scene popups and popup windows.
  This also affects 3rd party libraries.

- It causes inconveniences when styling the various popup types.
  Dialog, for instance, has a title property, which should be shown in
  the window title, and not inside the popup window.

- It also makes it less flexible for potential future changes. We've
  learned that this change is riskier, than initially expected, since
  the qobject and visual hierarchy of popup objects are different when
  using popup windows, and tests that simulate events,
  will need to send the events to a different window.

The introduction of the PopupType::Default value, allows us to, for
instance, add a property later in ApplicationWindow, or somewhere else,
to change the behavior of PopupType::Default. Meaning that we can still
add a more grandiose API, that affects the behavior of multiple popup
instances, if we think it's too cumbersome for developers to add
`popupType: Popup.Window` to all popup instances.

Task-number: QTBUG-121363
Change-Id: I544da820261607621a9b9ad5c4c9679e676e44a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-05-30 21:18:42 -07:00
Richard Moe Gustavsen 562353a720 manual test, menus: use Popup.popupType
Now that Popup has a popupType API, use it in favor
of AA_DontUseNativeMenuWindows.

Change-Id: I6b666e9c36f5d8b95701ac6a94c29ac3d7a6d206
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-05-30 15:28:48 +02:00
Richard Moe Gustavsen 67fcd9f035 Menus test: inform when a restart is needed
Changing whether or not to use a native menu bar requires
setting AA_DontUseNativeMenuBar. But this will only take
effect the next time the app is started. So inform about
this, since it can otherwise be quite confusing for the
"tester".

Change-Id: Ie37b9ec0cc66660548ea13cb383440536e6fd707
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-05-29 18:48:25 +02:00
Mitch Curtis 84998a7d78 menus: fix quitting with Cmd+Q on macOS
It seems the Quit menu bar item steals the shortcut, so we have to do
something with it.

Change-Id: I3831c8bc99728773e22284232d7ab54ba6eb117f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-20 10:13:44 +08:00
Shawn Rutledge 3b3b5a1743 Menus manual test: open context menu on mouse press or touch long-press
This enables testing the drag-press-release gesture.

Change-Id: I953fee1f891b2ac907a5a69ca98f720496e7ed91
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-16 15:41:46 -07:00
Richard Moe Gustavsen 5d5849117a manual test, menus: add support for more test cases
Add more logic to the manual test to test:
1. changing the delegate
2. changing the title of a menu in the menu bar
3. using sub menus
3. using checkable menu items in the menu bar menus

Change-Id: I6a7256fb368a3557837c0448a6ddc895bb24924d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-05-10 09:22:43 +02:00
Mitch Curtis d981634520 Add support for icons to native menus
Task-number: QTBUG-69558
Change-Id: I9486f474dd386061636c326b508c20848ebab807
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-06 10:49:48 +08:00
Mitch Curtis d2711e6961 menus: add shortcuts
Task-number: QTBUG-69558
Change-Id: I440fb7caff125d2417fb648df667219e42b375bc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-23 13:48:01 +08:00
Mitch Curtis 822db20f84 Menu, MenuBar: remove requestNative and rely solely on app attributes
It was decided that we'll have two attributes:

- AA_DontUseNativeMenuBar
- AA_DontUseNativeMenuWindows

Setting AA_DontUseNativeMenuWindows only affects windows we create
(context menus, combobox menus, menus of non-native menu bars).
So, setting AA_DontUseNativeMenuWindows restores Qt to today's behavior.
But we can't control the windows of native menu bars, so if you don't
want those to be native, you have to set AA_DontUseNativeMenuBar just
like today.

By removing requestNative, we also effectively default to native menus
and menu bars, as the attributes are not set by default.

[ChangeLog][Controls][Important Behavior Changes] Menu and MenuBar
now use native menus by default on platforms where they're supported.

Task-number: QTBUG-69558
Change-Id: Ia917c2f820634def0cf815aa8ca8895ca79db75d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-17 15:05:01 +08:00
Richard Moe Gustavsen 68d40a5d44 Merge remote-tracking branch 'origin/dev' into nativemenus
Change-Id: Id09a36871013f65e5f9185fed0e3658a43bc934e
2024-03-12 10:55:22 +01:00
Mitch Curtis cb7eb15220 Material: fix floating placeholder text x position
Don't set it to control.leftPadding, because we don't want it to change
if the user changes leftPadding.

Fixes: QTBUG-120149
Pick-to: 6.5 6.6 6.7
Change-Id: I67bbc22192fef386fe088398b67d3eb0a10421ba
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-03-07 09:32:12 +08:00
Volker Hilsheimer d0823fb78b Fix spelling of FFmpeg in (end-)user-visible strings
It's two capital "FF", lowercase "mpeg".

Pick-to: 6.7 6.6 6.5
Change-Id: Icc379d0a680612b612ee306be7749697906bf4c3
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-01 15:35:15 +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
Richard Moe Gustavsen 02a2ec0dc5 Manual test, menus: add support for testing menubar
Change-Id: Id8e55e3f3b05aab0ab02452452e08783181a7be8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-02-23 10:31:29 +01:00
Richard Moe Gustavsen 05b916be5c QQuickMenuBar: respect AA_DontUseNativeMenuBar
If the application sets AA_DontUseNativeMenuBar, it should
override the requestNative property.

Change-Id: Id69c09310d61e9a59746e32435a97742e28c80d3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-02-22 18:49:27 +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
Mitch Curtis 9fde076798 Menu: fix native checkable MenuItems (without an Action) not checking
Not only do we need to ensure that the checked state changes so that
syncing the MenuItem to the native menu item works, but we should also
emit the same signals that would be emitted if the user had actually
interacted with the MenuItem.

Task-number: QTBUG-69558
Change-Id: I0ac1d16c0f84da1d9f6639b724ba47ea124da59a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 18:43:42 +08:00
Mitch Curtis c97884540b Menu: support adding MenuItem to native menu
Originally the plan was to revert to a non-native menu when MenuItem
was used, but now that we always create the non-native items
regardless, we shouldn't need to do that.

Checkable MenuItems do not currently work. This will be implemented in
a follow-up commit.

Task-number: QTBUG-69558
Change-Id: I7238dad89e478f7cc664738fb6036787e0193dab
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 18:43:35 +08:00
Mitch Curtis 4c21626003 Menu: allow setting (but not always respecting) requestNative
We can allow this to be set while the menu is a sub-menu and/or
visible, and instead wait until it is re-opened to take the change into
effect.

Task-number: QTBUG-69558
Change-Id: Ie79819609950c2f6432e55c09d21dce7e8d9b220
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 18:43:32 +08:00
Mitch Curtis 6ea3edd493 Menu: respect requestNative changes
This patch ensures that a native menu is created (or destroyed)
when requestNative is set, if possible.

Task-number: QTBUG-69558
Change-Id: Ic7f8826bf4def66e66932618767a81ad19e114f0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-02-12 18:43:23 +08:00
Mitch Curtis d56e3f254f Implement native menu separator
Task-number: QTBUG-69558
Change-Id: I3da4509a722ec5ee4620111fc9482e6d688fdd9d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 18:43:20 +08:00
Richard Moe Gustavsen 23d9b5bfb7 Merge "Merge remote-tracking branch 'origin/dev' into nativemenus" 2024-01-22 11:53:28 +01:00
Richard Moe Gustavsen d28b13c7b1 Merge remote-tracking branch 'origin/dev' into nativemenus
Change-Id: I54bfced2ff9d5d897027dc81e6d5234d317b9b48
2024-01-22 09:00:10 +01:00
Mitch Curtis c48ef8428c Add disabled Actions to menus manual test
Task-number: QTBUG-69558
Change-Id: I6517a679a3fb80cda577971425e582c8bab5eba6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-01-22 12:52:11 +08:00
Mitch Curtis 9563db8763 Add checkable Actions to menus manual test
This can't reliably be auto-tested because we can't interact with menu
items with the mouse, and there's no way to know if a native menu is
focused in order to interact with it via keyboard.

Task-number: QTBUG-69558
Change-Id: I21134743ccc64ca1bf99f085f09c00d66a3ca3dc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-01-22 12:52:07 +08:00
Thiago Macieira e8e818df99 Doc & Test: fix syntax of QSettings sub-groups
These examples and .conf files were using two different syntax to create
a subgroup. QSettings may not support one of them and is misbehaving. So
let's use one syntax only and the one that it produces when writing the
output.

This code:

    s.beginGroup(u"Material");
    s.beginGroup(u"Font");
    s.setValue("Family", "Open Sans");
    s.setValue("PixelSize", 20);

Produces:

 [Material]
 Font\Family=Open Sans
 Font\PixelSize=20

Fixes: QTBUG-121035
Pick-to: 6.7 6.6
Change-Id: I76ffba14ece04f24b43efffd17ab7ea941910c19
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-01-19 13:11:15 +08:00
Mitch Curtis bedbc950d9 Menu: get native sub-menus working
Task-number: QTBUG-69558
Change-Id: Iee7393a00bcaf4f25f579ec60ebfecf7ef357761
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-01-17 10:07:37 +08:00
Mitch Curtis 01f06efa2a Add menus manual test
This gives us a convenient way to manually test native menus, which
can't be fully auto-tested.

Task-number: QTBUG-69558
Change-Id: I045eef8d30eb8f130f6e4ba4787a9d0ad84c109f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-01-17 10:07:34 +08:00
Mitch Curtis 540848a4ed Material: reduce padding for Dense variant of Button
The padding was increased with the Material 3 update
(f47f8d6931), but the Dense variant never
had an effect on the values. This patch changes that.

Fixes: QTBUG-119793
Pick-to: 6.5 6.6 6.7
Change-Id: Ic37bb7861fe5e3f3dc9e97fe4ee7369b487f89df
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-12-18 09:29:09 +08:00
Mårten Nordheim 0df834ee11 testbench: fix font name
fontawesome was replaced with fontello at some point

Change-Id: I435d06611ebf6f2b9b7647b0d769b75a3f6cd089
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-11-10 21:44:16 +01:00
Mitch Curtis 21a9e41422 macOS: add RadioDelegate
Task-number: QTBUG-115165
Change-Id: I166c4d71e62d8340a37bb11803ad209a88e4764f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-01 21:45:06 +08:00
Mitch Curtis b520beaf51 macOS: add CheckDelegate
Task-number: QTBUG-115165
Change-Id: Ie873592d74dcda4828ba753391c64929402736f8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-01 21:45:06 +08:00
Jan Arve Sæther 6e99bddb9e Move imagine/musicplayer to tests/manual/imagine/musicplayer
imagine/automotive already demonstrate the imagine style

Pick-to: 6.5 6.6
Task-number: QTBUG-108751
Change-Id: Ibb1fe187571b6693b85dfc0a310fc806908194dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-07-10 13:07:04 +02:00
Mitch Curtis 4ab11d03ac Material: fix placeholder text alignment
The placeholder text should always be aligned to the left
according to my tests on native Android via an emulator.

Fixes: QTBUG-113172
Pick-to: 6.5 6.5.1
Change-Id: I75ae31e1e6b9846d90ab5034c43f8684698e0ab7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-05-03 08:06:05 +08:00
Mitch Curtis 2d99c70f98 Material: fix TextArea decorations when in a Flickable
This patch fixes the following issues when the Material TextArea is
attached to a Flickable:
- Floating placeholder text scrolls with the Flickable.
- When text is cleared without the control having focus:
  - Floating placeholder text is positioned incorrectly.
  - The floating text background outline gap is still open.
- The background outline color is incorrect when the control has focus
  (used primaryTextColor instead of accentColor).

Pick-to: 6.5
Task-number: QTBUG-112650
Change-Id: Icfa3517e4abcb1209ea2291dabdec225011f19ef
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-04-19 10:57:41 +08:00
Santhosh Kumar c2b09e89da Remove side-panel and swipe-to-remove quickcontrol examples
The quickcontrol feature represented in side-panel and swipe-to-remove
were already part of gallery example and hence, removing these two
examples

Fixes: QTBUG-110989
Pick-to: 6.5.0
Change-Id: I496dfe7ee2bea98f918b4e3b72673388c51cda6b
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-03-03 07:37:00 +00:00
Amir Masoud Abdol 115e3f73e4 Exclude tst_gifs from non-linux systems
It relies on byzanz-record, which is only available on LINUX.

Pick-to: 6.5
Change-Id: Ia71208392a363c7f612addb30b117ac740eb8e49
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-27 12:59:50 +01:00
Mitch Curtis ddcc6c7570 Improve styles manual test
- Add usage instructions.
- Give the content more room so the sliders are larger.
- Ensure that the Sliders fill their layout's width to take up the extra space.
- Ensure that the GroupBoxes fill the width of the ColumnLayout so that the extra space is used.
- Split lines with multiple statements.
- Remove "2" from window title.

Pick-to: 6.5
Change-Id: I3c371f8060db8b7035f82ed772d673340e12772d
Reviewed-by: Doris Verria <doris.verria@qt.io>
2023-02-24 10:41:16 +08:00
Mitch Curtis 5704741a40 Update Material TextArea to Material 3
Fixes: QTBUG-110231
Pick-to: 6.5
Change-Id: I8b6e5a2bc8e91c7003206e8a651b133f3a541617
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-02-21 19:13:59 +08:00
Matthias Rauter 1f6489be57 Fix build issues in multiple manual tests
Pick-to: 6.5
Change-Id: Id805713c9989146e385433c70ae2f756db0b9bff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-02-21 08:20:51 +00:00
Mitch Curtis 20e3d1b522 Update Material TextField to Material 3
Fixes: QTBUG-72554
Fixes: QTBUG-109218
Pick-to: 6.5
Change-Id: I0bc6fc3d16630352dcd5c58c5dd2b1bf794741c5
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-02-17 03:55:30 +08:00
Tor Arne Vestbø c0918d6306 Adapt to Qt::Appearance to Qt::ColorScheme rename
Pick-to: 6.5
Change-Id: I5830af713e024fa9a7086e8c56e6808ff8593394
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-13 12:52:54 +01:00
Amir Masoud Abdol c2d37f9646 Retire the qt_parse_all_arguments
Task-number: QTBUG-99238
Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-20 16:40:42 +01:00
Richard Moe Gustavsen f8207a204b Fusion, HeaderView: use colors from the style
Don't hard code colors in HorizontalHeaderView and
VerticalHeaderView. Instead, use colors from the
palette / style. This ensures that switching between
light and dark mode will also affect HeaderView.

Additionally, skip drawing a box around the header view
cells - doing so ends up looking quite bad, since you
will draw double lines between the cells (especially
when the columnSpace/rowSpace is 0. Instead, the border
around the cells in both TableView and HeaderView is
supposed to be drawn indirectly from setting rowSpacing
and columnSpacing to e.g 1.

Pick-to: 6.5 6.4
Change-Id: Ibc01779526aecc4f0d40fad2a6f2ea2822427e85
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-01-17 21:58:32 +01:00
Mitch Curtis 29106dc0c0 testbench: save search text between session
This makes using the testbench more convenient, as you don't need to
search for the controls you're interested in each time you run it.

Also added an extra font icon (clear), which required regenerating
the set from fontello. The same license is still applicable since
they're from Font Awesome.

Pick-to: 6.5
Change-Id: I9b44f7f8bce0bb4032071c19186eb5affbfe42a5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-01-03 12:09:41 +08:00