| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The included test fails every now and then for Imagine, Fusion
and Mac style. By using QTRY_VERIFY to wait a bit before we check
if the menu is highlighted, it seems to pass each time.
Change-Id: Ib8b207e1b5f81b3086595bb8ad7dc6881272def1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is close to what the widget QMenu (and Windows native menu) do.
Before, the active menu was left open and Alt+<key> shortcut would be
delivered to one of the matching items, which might be an item shadowed
by the active menu popup.
With this patch, the active menu is closed on Alt key pressed so the
subsequent shortcut event will (likely) be delivered to the matching
MenuBar item. Since I'm going to fix the issue of &mnemonic key conflict
resolution, I need to first change the way of delivering a shortcut
event to the parent MenuBar.
The test cases use the undocumented function to simulate low-level
behavior of Alt itself and Alt+<key> events. Apparently, there's no
public QTest function to send multiple key events without releasing Alt
modifier.
Task-number: QTBUG-86276
Pick-to: 5.15
Change-Id: I0ed6ea94f0fee7983a5cb6352d388036d3a1f8df
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-82922
Change-Id: I75f4a553a6bb260f77bfa791f12fa42e80131e09
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
As of Qt 6, the latest version will be used by default. This saves us a
lot of effort in terms of version bumps.
Task-number: QTBUG-82922
Change-Id: I74eba8185ec3ccc75bc293d4b2ea87d59e2d9928
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We're still getting failures after QCOMPARE was fixed
(in c78a960198d59fb9a9ddd83ad7098b1db396edfd):
FAIL! : tst_QQuickMenu::Material::subMenuPosition(cascading,flip) Compared doubles are not the same (fuzzy compare)
Actual (subSubMenu1->popupItem()->x()) : 3.88240550819e-11
Expected (subMenu1->popupItem()->x() - subSubMenu1->width() + overlap): 0
tst_qquickmenu.cpp(1532) : failure location
Quoting Eddy:
"[...] the threshold for double equality is one part in 1e12; the
threshold for fuzzy-is-zero is likewise 1e-12; so 3e-11 is non-zero.
One work-around, of course, would be to cast float(each operand) so as
to get float's wider tolerance (one part in 100,000, null if less than
1e-5)."
So that's what we do in this patch.
Change-Id: Iecf1b6f4b2cf2c81eb652bb0f565ac682b024dae
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
| |
This has no effect.
Task-number: QTBUG-66320
Pick-to: 5.15 5.12
Change-Id: Ie6efb26243178c4044ac0bc721c21ad89769c982
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][Controls][ApplicationWindow] The deprecated overlay
properties and attached API were removed. Use the Overlay attached type
instead.
Task-number: QTBUG-84715
Change-Id: I0781ea55ea502ffe5277385e82492291724d2090
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][Controls][Menu] The deprecated removeItem(var)
function was removed. removeItem(Item) or takeItem(int) can be used
instead.
Change-Id: I79757c22b4f81e1b380798623bd1f15eb09c1647
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit c463f09fcb63927c66bc3307ddcc88d85d38b2bc.
After c78a960198d59fb9a9ddd83ad7098b1db396edfd in qtbase, this shouldn't be
necessary.
Pick-to: 5.15
Change-Id: I1789eae295b1ebc44630b758414087344909ea60
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the docs of QCOMPARE:
"[...] expecting 0 can fail when the actual value may be affected by
rounding errors. One solution to this is to offset both actual and
expected values by adding some suitable constant (such as 1)."
Pick-to: 5.15
Change-Id: Ie7c0db9b4eb6c7d9fdb503421242d309a39bc2ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ie09cfdd17b00e56f3ba8677d25b24417dd4e42f6
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If there is padding around the menu then it will mean the available
height is smaller than the containing item and as such should be
interactive.
Fixes: QTBUG-82473
Change-Id: Ie3e7568ab66aa3da93e5448c1a27c9bd2a5e486a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
It relies on moving the cursor.
Task-number: QTBUG-76312
Change-Id: I317083b974d3e9e8d6d616dc3248ee64e0f36021
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: Ifd6b2289de6465a010f5f2a32789221767b4d5be
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|\ \
| | |
| | |
| | | |
Change-Id: Ieb9bcfba9651d646509afd065ce2389ef74448cc
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It relies on moving the cursor.
Task-number: QTBUG-76312
Change-Id: I317083b974d3e9e8d6d616dc3248ee64e0f36021
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit a2443f0a34da85de014b9507926c4ac415543b03)
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I3a57449c9025e22414b8337fcffdeb0f4d769af2
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
Initial conversion of QtQuickControls2 tests.
Change-Id: I7e09e387ec90f89cc2856c7f7f2cb810b03b7fa3
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
These tests where failing sometimes in our CI, because centerOnScreen()
was invoked which asks the window manager to move the window, but does
not wait for the event's completion. The solution is to do all that
*before* the initial qWaitForWindowActive().
Fixes: QTBUG-73128
Change-Id: I06c1f85d5ff9657dccab50f29084f7624cd7e194
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The important part of the "cascading" test is checking that the sub-sub
menu eventually opens, so move the !visible check to the non-cascading
branch of the if statement.
Change-Id: I5a09bf0b5d45832f7b75c3e8c397fdb9e6fcc011
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Short version:
There are currently two problems with MenuItems:
- Mirrored MenuItems don't fill the Menu's available width.
- MenuItem does not fill the Menu's available width when changed
after Component completion.
This patch fixes both of them by listening to geometry changes in both
the contentItem and individual menu items, and setting the explicit
width of those menu items when either changes.
Longer version:
The first problem can be seen whenever the MenuItem's implicitWidth
changes:
- QQmlEngine::retranslate() is called, causing all bindings to be
re-evaluated
- The MenuItem's font size changes
- The MenuItem's icon size changes
- etc.
We fix this by making Menu listen to the width of each of its MenuItems
and call resizeItem() if it doesn't have an explicit width.
The second problem can be seen when e.g. resizing a Menu to account
for new items that are wider and hence require more space.
This can be fixed by listening to width changes in Menu's contentItem,
which was actually done in earlier versions but (probably accidentally)
removed in 482ecb0f.
I had tried to solve both issues by setting the explicit width of
MenuItem to the width of its Menu, or undefined if it has none
(which means it reverts to its implicit width). However, this does
not account for e.g. MenuSeparator and custom items that can be added
to Menu - they should also have their width fill the Menu automatically
if they don't have an explicit width set.
Change-Id: I95dd0da0919a1e297f2e2030da746ff1f1a17644
Fixes: QTBUG-75051
Fixes: QTBUG-75142
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is a prerequisite for ensuring that an Imagine-style-specific fix
works.
Fixes: QTBUG-75141
Change-Id: Iafef3bf947151cb35b88a1230e3541d8e4e15fd9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch, only space was allowed.
Windows 10 and macOS 10.14.2 both allow using enter to activate menu
items.
Change-Id: I64476347669ff73f233efd129563a18ba51618a5
Fixes: QTBUG-73354
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
| |
Change-Id: I7eb394ca3991eae585fbbd8e665c46b11ef64a07
Fixes: QTBUG-70181
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
When a menu item with a sub-menu was triggered by key or mouse,
it would open the sub-menu with the first menu item highlighted.
This doesn't make sense for disabled menu items, so this patch
makes it find the first enabled item.
Change-Id: I9df1c750749e5a77b027b6f476b8ae1f5ea035bd
Fixes: QTBUG-69540
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem
Consider the following code:
Menu {
title: "Menu"
Action {
text: "Item"
onTriggered: enabled = false
}
}
A MenuItem (AbstractButton) is created for the Action, and when it is
clicked, this function is called:
void QQuickAbstractButtonPrivate::trigger()
{
Q_Q(QQuickAbstractButton);
if (action && action->isEnabled())
QQuickActionPrivate::get(action)->trigger(q, false);
else if (effectiveEnable)
emit q->clicked();
}
QQuickActionPrivate::get(action)->trigger(q, false) results in this
function being called:
void QQuickAbstractButtonPrivate::click()
{
Q_Q(QQuickAbstractButton);
if (effectiveEnable)
emit q->clicked();
}
Since the action (and hence the menu item) was disabled in the signal
handler, the effectiveEnable check fails and clicked() is not emitted.
This causes the menu to not be dismissed.
Solution
Before calling QQuickActionPrivate::get(action)->trigger(), store
the button's enabled state. If triggering the action causes the action
to be disabled (due to the signal handler), we can then choose whether
or not we emit QQuickAbstractButton::clicked(). Specifically, we emit
clicked() if:
- we were enabled before triggering the action, and
- we have no associated action, or it's no longer enabled
Task-number: QTBUG-69682
Change-Id: Ib4e3c313b776decc74089a6beffe415605c430be
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts the following commits:
d5cb26bc56a3b6f6e99c88654d4f7a65f43551ac - Menu: ensure the correct delegates are used when created via Component
d923dd467c1aeb3e195a09949b04862084002f88 - MenuBar: ensure the correct delegates are used when created via Component
d56c193eb4ceb640611d66f22e1f26aae91cd7d1 - QQuickPopupPositioner: avoid adding duplicate item change listeners
567a2de8cd493aabe0055d6dbc367b39447e70dd - Stabilize tst_qquickmenubar
953fbac6131823e4fce0eb4707a854469c4c04ff - Fix Instantiator-created MenuItems disappearing
936d31179d44220571ded15840bedeccb581c83b - tst_qquickmenu: add a test for MenuItems before and after a Repeater
fc1832810f6c09505d9413685ed0b2d6295bea4a - QQuickMenuBar: fix menu not opening
The fix for QTBUG-67559 has caused lots of issues, with the latest being a
crash right before the 5.12 release. The bug that they fix is a P2,
so it's not worth the hassle. The patches might be able to be resubmitted
to dev after the crash is fixed.
Change-Id: Ic192c7a302176bcdb2503b636b3462b10898a2ba
Fixes: QTBUG-71770
Reviewed-by: J-P Nurmi <jpnurmi@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
| |
Just to verify that it works, as a similar test was added for
Instantiator in another patch.
Change-Id: I1ab55d98a3726bff1a2984db0d81ae444e05d630
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When d5cb26bc fixed a bug in Menu, it also broke the use case
of having an Instantiator create menu items. Using an Instantiator
like this allows users to create a "Recent Files" menu, for example.
The issue was that we would indiscriminately recreate items, even
those owned by an Instantiator.
This patch avoids recreating items owned by Instantiators.
It also adds a logging category for Menu, to aid debugging.
Fixes: QTBUG-71066
Change-Id: Ie0e46de1cbfaee81b43d63f3143435f2514371d5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes all Qt Quick Controls 2 imports match the current
Qt minor version, which is 12 as of this patch.
It also updates all other Qt Quick imports to match.
This will also make future version bumps easier as all version numbers
in existing code/docs will match.
The following commands were used to verify that no old versions remain:
for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done
for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done
for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done
[ChangeLog] From Qt 5.12 onwards, all import versions in
Qt Quick Controls 2 follow the same minor version as Qt's
minor version number. For example, the import version for Qt 5.12 is:
"import QtQuick.Controls 2.12".
Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3
Fixes: QTBUG-71095
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
takeItem() unparents the item, so we need to make sure it gets deleted.
The leak was caught by valgrind:
==10039== 832 (32 direct, 800 indirect) bytes in 1 blocks are definitely lost in loss record 6,465 of 6,706
==10039== at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10039== by 0x112C1E: tst_QQuickMenu::count() (tst_qquickmenu.cpp:121)
==10039== by 0x12F313: tst_QQuickMenu::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (tst_qquickmenu.moc:156)
==10039== by 0x612B6B2: QMetaMethod::invoke(QObject*, Qt::ConnectionType, QGenericReturnArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument, QGenericArgument) const (qmetaobject.cpp:2305)
==10039== by 0x41B07CD: invoke (qmetaobject.h:123)
==10039== by 0x41B07CD: QTest::TestMethods::invokeTestOnData(int) const (qtestcase.cpp:915)
==10039== by 0x41B15BF: QTest::TestMethods::invokeTest(int, char const*, QTest::WatchDog*) const (qtestcase.cpp:1114)
==10039== by 0x41B1D07: QTest::TestMethods::invokeTests(QObject*) const (qtestcase.cpp:1456)
==10039== by 0x41B2381: QTest::qRun() (qtestcase.cpp:1896)
==10039== by 0x41B24E1: QTest::qExec(QObject*, int, char**) (qtestcase.cpp:1783)
==10039== by 0x12F468: main (tst_qquickmenu.cpp:1505)
Change-Id: I459c7897c1088c8b58152d2e0b5ceb8f3684e589
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Don't add items until we're complete, as the delegate could change in
the meantime. Instead, add them to contentData and create them when
we're complete.
Task-number: QTBUG-67559
Change-Id: I5f42129f49de861ff5f15d0069daeda0b4e5017c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Use Window.window instead of ApplicationWindow.window, as the former
will always result in a window regardless of which type of window is
in use.
Task-number: QTBUG-68858
Change-Id: I3bdb60350d92b13621b0f4db9085bf067b6ff6e2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Conflicts:
.gitignore
tests/auto/auto.pro
tests/auto/qquickmenu/tst_qquickmenu.cpp
tests/auto/qquickpopup/tst_qquickpopup.cpp
Change-Id: I7e5a7b39d890796fd63a7b24ae19765ab41fecda
|
|
Change-Id: I1c7e1a2b337e9d16bc6c9b098db08f29f1b9d1e6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|