From 335314146dece4fa86c661a4094a2f73e5e81a43 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 15 Jan 2019 13:05:39 +0100 Subject: Doc: Fix documentation warnings for Qt Quick Controls 2 - The correct module header name is QtQuickControls2 - Add dependency to qtgraphicaleffetcs - RangeSlider: Move \qmlsignal commands out of \qmlpropertygroup - Fix linking to content[Width|Height] for ScrollView Change-Id: I1636fef5f4365a8e9f80b0b8df17e78999bfd3f8 Reviewed-by: Paul Wicking Reviewed-by: Mitch Curtis --- src/imports/controls/doc/qtquickcontrols.qdocconf | 4 +++- src/quicktemplates2/qquickrangeslider.cpp | 29 ++++++++++------------- src/quicktemplates2/qquickscrollview.cpp | 3 ++- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/imports/controls/doc/qtquickcontrols.qdocconf b/src/imports/controls/doc/qtquickcontrols.qdocconf index 2a01d058..fd921562 100644 --- a/src/imports/controls/doc/qtquickcontrols.qdocconf +++ b/src/imports/controls/doc/qtquickcontrols.qdocconf @@ -1,6 +1,8 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) include(manifest-meta.qdocconf) +moduleheader = QtQuickControls2 + project = QtQuickControls description = Qt Quick Controls Reference Documentation version = $QT_VERSION @@ -31,7 +33,7 @@ qhp.QtQuickControls.subprojects.examples.title = Examples qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples qhp.QtQuickControls.subprojects.examples.selectors = fake:example -depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols1 qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform +depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols1 qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects # Specify the install path under QT_INSTALL_EXAMPLES # Note: paths passed to \example command must contain the parent directory, e.g. diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp index ff488dac..acf4dca3 100644 --- a/src/quicktemplates2/qquickrangeslider.cpp +++ b/src/quicktemplates2/qquickrangeslider.cpp @@ -752,7 +752,6 @@ qreal QQuickRangeSlider::valueAt(qreal position) const \qmlproperty bool QtQuick.Controls::RangeSlider::first.hovered \qmlproperty real QtQuick.Controls::RangeSlider::first.implicitHandleWidth \qmlproperty real QtQuick.Controls::RangeSlider::first.implicitHandleHeight - \qmlsignal void QtQuick.Controls::RangeSlider::moved() \table \header @@ -801,15 +800,9 @@ qreal QQuickRangeSlider::valueAt(qreal position) const \li implicitHandleHeight \li This property holds the implicit height of the first handle. This property was introduced in QtQuick.Controls 2.5. - \row - \li moved() - \li This signal is emitted when the first handle has been interactively moved - by the user by either touch, mouse, or keys. - - This signal was introduced in QtQuick.Controls 2.5. \endtable - \sa first.increase(), first.decrease() + \sa first.moved(), first.increase(), first.decrease() */ QQuickRangeSliderNode *QQuickRangeSlider::first() const { @@ -817,6 +810,17 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const return d->first; } +/*! + \qmlsignal void QtQuick.Controls::RangeSlider::first.moved() + \qmlsignal void QtQuick.Controls::RangeSlider::second.moved() + \since QtQuick.Controls 2.5 + + This signal is emitted when either the first or second handle has been + interactively moved by the user by either touch, mouse, or keys. + + \sa first, second +*/ + /*! \qmlpropertygroup QtQuick.Controls::RangeSlider::second \qmlproperty real QtQuick.Controls::RangeSlider::second.value @@ -827,7 +831,6 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const \qmlproperty bool QtQuick.Controls::RangeSlider::second.hovered \qmlproperty real QtQuick.Controls::RangeSlider::second.implicitHandleWidth \qmlproperty real QtQuick.Controls::RangeSlider::second.implicitHandleHeight - \qmlsignal void QtQuick.Controls::RangeSlider::moved() \table \header @@ -876,15 +879,9 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const \li implicitHandleHeight \li This property holds the implicit height of the second handle. This property was introduced in QtQuick.Controls 2.5. - \row - \li moved() - \li This signal is emitted when the second handle has been interactively moved - by the user by either touch, mouse, or keys. - - This signal was introduced in QtQuick.Controls 2.5. \endtable - \sa second.increase(), second.decrease() + \sa second.moved(), second.increase(), second.decrease() */ QQuickRangeSliderNode *QQuickRangeSlider::second() const { diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index c0f73692..98bd174e 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -78,7 +78,8 @@ QT_BEGIN_NAMESPACE \li If only a single item is used within a ScrollView, the content size is automatically calculated based on the implicit size of its contained item. However, if more than one item is used (or an implicit size is not - provided), the \l contentWidth and \l contentHeight properties must + provided), the \l {QtQuick.Controls::Pane::}{contentWidth} and + \l {QtQuick.Controls::Pane::}{contentHeight} properties must be set to the combined size of its contained items. \li If the content size is less than or equal to the size of the ScrollView, it will not be flickable. -- cgit v1.2.3 From 7d001497ddcda501c55aac35b4c7a60980d9c6b5 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 6 May 2019 17:04:27 +0200 Subject: Fix flaky tst_qquickmenu test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jüri Valdmann --- tests/auto/qquickmenu/tst_qquickmenu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp index 49fdc066..f22ac972 100644 --- a/tests/auto/qquickmenu/tst_qquickmenu.cpp +++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp @@ -1105,8 +1105,9 @@ void tst_QQuickMenu::subMenuMouse() QCOMPARE(mainMenu->isVisible(), cascade); QVERIFY(subMenu1->isVisible()); QVERIFY(!subMenu2->isVisible()); - QVERIFY(!subSubMenu1->isVisible()); - if (cascade) { + if (!cascade) { + QVERIFY(!subSubMenu1->isVisible()); + } else { QTRY_VERIFY(subSubMenu1->isVisible()); QTRY_VERIFY(subSubMenu1->isOpened()); } -- cgit v1.2.3 From 9310d5fb5285ae5eb4b94c01606791319b775b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Mon, 6 May 2019 14:09:11 +0200 Subject: Container: Keep currentIndex at 0 when removing item 0 if possible Current behavior is to always decrement the currentIndex when the current item is removed -- even when the current item is item 0. This means, for example, that in a TabBar with three tabs and the first tab selected closing the first tab will leave nothing at all selected. Change behavior to keep currentIndex at 0 if there are still items left in the container. Now closing the first tab will leave the next remaining tab selected. Change-Id: If4e1903366e29fcee8226b776d5b2e03cec189df Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontainer.cpp | 4 ++-- tests/auto/controls/data/tst_tabbar.qml | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp index 2c357f82..8314230c 100644 --- a/src/quicktemplates2/qquickcontainer.cpp +++ b/src/quicktemplates2/qquickcontainer.cpp @@ -294,8 +294,9 @@ void QQuickContainerPrivate::removeItem(int index, QQuickItem *item) updatingCurrent = true; + int count = contentModel->count(); bool currentChanged = false; - if (index == currentIndex) { + if (index == currentIndex && (index != 0 || count == 1)) { q->setCurrentIndex(currentIndex - 1); } else if (index < currentIndex) { --currentIndex; @@ -308,7 +309,6 @@ void QQuickContainerPrivate::removeItem(int index, QQuickItem *item) q->itemRemoved(index, item); - int count = contentModel->count(); for (int i = index; i < count; ++i) q->itemMoved(i, itemAt(i)); diff --git a/tests/auto/controls/data/tst_tabbar.qml b/tests/auto/controls/data/tst_tabbar.qml index 519b1d53..42e767f2 100644 --- a/tests/auto/controls/data/tst_tabbar.qml +++ b/tests/auto/controls/data/tst_tabbar.qml @@ -270,6 +270,29 @@ TestCase { compare(contentChildrenSpy.count, 12) } + function test_removeCurrent() { + var control = createTemporaryObject(tabBar, testCase) + + control.addItem(tabButton.createObject(control, {text: "1"})) + control.addItem(tabButton.createObject(control, {text: "2"})) + control.addItem(tabButton.createObject(control, {text: "3"})) + control.currentIndex = 1 + compare(control.count, 3) + compare(control.currentIndex, 1) + + control.removeItem(1) + compare(control.count, 2) + compare(control.currentIndex, 0) + + control.removeItem(0) + compare(control.count, 1) + compare(control.currentIndex, 0) + + control.removeItem(0) + compare(control.count, 0) + compare(control.currentIndex, -1) + } + Component { id: contentBar TabBar { -- cgit v1.2.3 From 7431b0549a9bb69f5f4a036fc931683dd4e20d2c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 14 May 2019 10:51:35 +0200 Subject: tst_accessibility: Simplify role verification Instead of casting to int and back to enum, just use the enum directly. Change-Id: Ifbd6a74ee499ffaeb99b0b4274cd59365833bfbd Reviewed-by: Liang Qi --- tests/auto/accessibility/tst_accessibility.cpp | 100 ++++++++++++------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 7e491b54..0224f020 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -64,56 +64,56 @@ private: void tst_accessibility::a11y_data() { QTest::addColumn("name"); - QTest::addColumn("role"); + QTest::addColumn("role"); QTest::addColumn("text"); - QTest::newRow("AbstractButton") << "abstractbutton" << 0x0000002B << "AbstractButton"; //QAccessible::Button - QTest::newRow("BusyIndicator") << "busyindicator" << 0x00000027 << ""; //QAccessible::Indicator - QTest::newRow("Button") << "button" << 0x0000002B << "Button"; //QAccessible::Button - QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox - QTest::newRow("CheckDelegate") << "checkdelegate" << 0x0000002C << "CheckDelegate"; //QAccessible::CheckBox - QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox - QTest::newRow("Container") << "container" << 0x00000000 << ""; //QAccessible::NoRole - QTest::newRow("Control") << "control" << 0x00000000 << ""; //QAccessible::NoRole - QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial - QTest::newRow("Dialog") << "dialog" << 0x00000012 << "Dialog"; //QAccessible::Dialog - QTest::newRow("Drawer") << "drawer" << 0x00000012 << ""; //QAccessible::Dialog - QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border - QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping - QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem - QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText - QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu - QTest::newRow("MenuItem") << "menuitem" << 0x0000000C << "MenuItem"; //QAccessible::MenuItem - QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab - QTest::newRow("PageIndicator") << "pageindicator" << 0x00000027 << ""; //QAccessible::Indicator - QTest::newRow("Pane") << "pane" << 0x00000010 << ""; //QAccessible::Pane - QTest::newRow("Popup") << "popup" << 0x00000012 << ""; //QAccessible::Dialog - QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar - QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton - QTest::newRow("RadioDelegate") << "radiodelegate" << 0x0000002D << "RadioDelegate"; //QAccessible::RadioButton - QTest::newRow("RangeSlider") << "rangeslider" << 0x00000033 << ""; //QAccessible::Slider - QTest::newRow("RoundButton") << "roundbutton" << 0x0000002B << "RoundButton"; //QAccessible::Button - QTest::newRow("ScrollBar") << "scrollbar" << 0x00000003 << ""; //QAccessible::ScrollBar - QTest::newRow("ScrollIndicator") << "scrollindicator" << 0x00000027 << ""; //QAccessible::Indicator - QTest::newRow("Slider") << "slider" << 0x00000033 << ""; //QAccessible::Slider - QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox - QTest::newRow("StackView") << "stackview" << 0x00000080 << ""; //QAccessible::LayeredPane - QTest::newRow("SwipeDelegate") << "swipedelegate" << 0x00000022 << "SwipeDelegate"; //QAccessible::ListItem - QTest::newRow("SwipeView") << "swipeview" << 0x0000003C << ""; //QAccessible::Pane - QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button - QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem - QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList - QTest::newRow("TabButton") << "tabbutton" << 0x00000025 << "TabButton"; //QAccessible::PageTab - QTest::newRow("TextArea") << "textarea" << 0x0000002A << ""; //QAccessible::Accessible.EditableText - QTest::newRow("TextField") << "textfield" << 0x0000002A << ""; //QAccessible::Accessible.EditableText - QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar - QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button - QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip - QTest::newRow("Tumbler") << "tumbler" << 0x00000000 << ""; //QAccessible::NoRole (TODO) - - QTest::newRow("DayOfWeekRow") << "dayofweekrow" << 0x0 << "DayOfWeekRow"; //QAccessible::NoRole - QTest::newRow("MonthGrid") << "monthgrid" << 0x0 << "MonthGrid"; //QAccessible::NoRole - QTest::newRow("WeekNumberColumn") << "weeknumbercolumn" << 0x0 << "WeekNumberColumn"; //QAccessible::NoRole + QTest::newRow("AbstractButton") << "abstractbutton" << QAccessible::Button << "AbstractButton"; + QTest::newRow("BusyIndicator") << "busyindicator" << QAccessible::Indicator << ""; + QTest::newRow("Button") << "button" << QAccessible::Button << "Button"; + QTest::newRow("CheckBox") << "checkbox" << QAccessible::CheckBox << "CheckBox"; + QTest::newRow("CheckDelegate") << "checkdelegate" << QAccessible::CheckBox << "CheckDelegate"; + QTest::newRow("ComboBox") << "combobox" << QAccessible::ComboBox << "ComboBox"; + QTest::newRow("Container") << "container" << QAccessible::NoRole << ""; + QTest::newRow("Control") << "control" << QAccessible::NoRole << ""; + QTest::newRow("Dial") << "dial" << QAccessible::Dial << ""; + QTest::newRow("Dialog") << "dialog" << QAccessible::Dialog << "Dialog"; + QTest::newRow("Drawer") << "drawer" << QAccessible::Dialog << ""; + QTest::newRow("Frame") << "frame" << QAccessible::Border << ""; + QTest::newRow("GroupBox") << "groupbox" << QAccessible::Grouping << "GroupBox"; + QTest::newRow("ItemDelegate") << "itemdelegate" << QAccessible::ListItem << "ItemDelegate"; + QTest::newRow("Label") << "label" << QAccessible::StaticText << "Label"; + QTest::newRow("Menu") << "menu" << QAccessible::PopupMenu << ""; + QTest::newRow("MenuItem") << "menuitem" << QAccessible::MenuItem << "MenuItem"; + QTest::newRow("Page") << "page" << QAccessible::PageTab << "Page"; + QTest::newRow("PageIndicator") << "pageindicator" << QAccessible::Indicator << ""; + QTest::newRow("Pane") << "pane" << QAccessible::Pane << ""; + QTest::newRow("Popup") << "popup" << QAccessible::Dialog << ""; + QTest::newRow("ProgressBar") << "progressbar" << QAccessible::ProgressBar << ""; + QTest::newRow("RadioButton") << "radiobutton" << QAccessible::RadioButton << "RadioButton"; + QTest::newRow("RadioDelegate") << "radiodelegate" << QAccessible::RadioButton << "RadioDelegate"; + QTest::newRow("RangeSlider") << "rangeslider" << QAccessible::Slider << ""; + QTest::newRow("RoundButton") << "roundbutton" << QAccessible::Button << "RoundButton"; + QTest::newRow("ScrollBar") << "scrollbar" << QAccessible::ScrollBar << ""; + QTest::newRow("ScrollIndicator") << "scrollindicator" << QAccessible::Indicator << ""; + QTest::newRow("Slider") << "slider" << QAccessible::Slider << ""; + QTest::newRow("SpinBox") << "spinbox" << QAccessible::SpinBox << ""; + QTest::newRow("StackView") << "stackview" << QAccessible::LayeredPane << ""; + QTest::newRow("SwipeDelegate") << "swipedelegate" << QAccessible::ListItem << "SwipeDelegate"; + QTest::newRow("SwipeView") << "swipeview" << QAccessible::PageTabList << ""; + QTest::newRow("Switch") << "switch" << QAccessible::Button << "Switch"; + QTest::newRow("SwitchDelegate") << "switchdelegate" << QAccessible::ListItem << "SwitchDelegate"; + QTest::newRow("TabBar") << "tabbar" << QAccessible::PageTabList << ""; + QTest::newRow("TabButton") << "tabbutton" << QAccessible::PageTab << "TabButton"; + QTest::newRow("TextArea") << "textarea" << QAccessible::EditableText << ""; + QTest::newRow("TextField") << "textfield" << QAccessible::EditableText << ""; + QTest::newRow("ToolBar") << "toolbar" << QAccessible::ToolBar << ""; + QTest::newRow("ToolButton") << "toolbutton" << QAccessible::Button << "ToolButton"; + QTest::newRow("ToolTip") << "tooltip" << QAccessible::ToolTip << "ToolTip"; + QTest::newRow("Tumbler") << "tumbler" << QAccessible::NoRole << ""; // TODO + + QTest::newRow("DayOfWeekRow") << "dayofweekrow" << QAccessible::NoRole << "DayOfWeekRow"; + QTest::newRow("MonthGrid") << "monthgrid" << QAccessible::NoRole << "MonthGrid"; + QTest::newRow("WeekNumberColumn") << "weeknumbercolumn" << QAccessible::NoRole << "WeekNumberColumn"; } #if QT_CONFIG(accessibility) @@ -127,7 +127,7 @@ static QPlatformAccessibility *platformAccessibility() void tst_accessibility::a11y() { QFETCH(QString, name); - QFETCH(int, role); + QFETCH(QAccessible::Role, role); QFETCH(QString, text); QString fn = name; @@ -169,7 +169,7 @@ void tst_accessibility::a11y() } } QVERIFY(acc); - QCOMPARE(acc->role(), (QAccessible::Role)role); + QCOMPARE(acc->role(), role); QCOMPARE(acc->name(), text); #else Q_UNUSED(role) -- cgit v1.2.3 From c49bb5bda32477a878b6b82b99f853cef1340890 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 15 May 2019 14:58:01 +0200 Subject: CursorDelegate: stop cursor timer when interval is set to 0 The cursor flash iterval can sometimes be set to 0. This is done from e.g the iOS plugin while selecting text, since the cursor should not flash when the user is dragging it around inside a magnifier glass. Setting the interval to 0 simply means "don't flash", rather than "hide the cursor". But setting the interval of a QML Timer to 0 will cause it to never trigger, which is not what we want, since then the cursor can end up staying hidden if done in-between two "flashes". This patch will add an extra condition that checks for this case. Fixes: QTBUG-75844 Change-Id: Ib1ca594a49a18cb161a2b2a67928fb6766984988 Reviewed-by: Shawn Rutledge --- src/imports/controls/material/CursorDelegate.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml index f472e8ae..1626a6fb 100644 --- a/src/imports/controls/material/CursorDelegate.qml +++ b/src/imports/controls/material/CursorDelegate.qml @@ -55,7 +55,7 @@ Rectangle { Timer { id: timer - running: cursor.parent.activeFocus && !cursor.parent.readOnly + running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0 repeat: true interval: Qt.styleHints.cursorFlashTime / 2 onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 -- cgit v1.2.3 From 1427b243cb69768e7ce2e6ea3ad75619deac104b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 16 May 2019 15:46:22 +0200 Subject: Don't unnecessarily transform keysequences into strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we cannot interpret them as the original key sequence anymore. When passing them on they are interpreted as the number key that represents the numeric value of the key sequence enum. Change-Id: Idd94ef95bc693cb6d51162dd1994adc953b52e25 Fixes: QTBUG-75572 Reviewed-by: Henning Gründl Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickaction.cpp | 2 +- tests/auto/controls/data/tst_action.qml | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/quicktemplates2/qquickaction.cpp b/src/quicktemplates2/qquickaction.cpp index e83fd353..033173f8 100644 --- a/src/quicktemplates2/qquickaction.cpp +++ b/src/quicktemplates2/qquickaction.cpp @@ -185,7 +185,7 @@ void QQuickActionPrivate::setShortcut(const QVariant &var) for (QQuickActionPrivate::ShortcutEntry *entry : qAsConst(shortcutEntries)) entry->ungrab(); - vshortcut = var.toString(); + vshortcut = var; keySequence = variantToKeySequence(var); defaultShortcutEntry->grab(keySequence, enabled); diff --git a/tests/auto/controls/data/tst_action.qml b/tests/auto/controls/data/tst_action.qml index ef28c0e5..0e41b7f3 100644 --- a/tests/auto/controls/data/tst_action.qml +++ b/tests/auto/controls/data/tst_action.qml @@ -165,4 +165,33 @@ TestCase { keyClick(Qt.Key_A, Qt.ControlModifier) compare(spy.count, 1) } + + Component { + id: shortcutBinding + Item { + Action { + id: action + shortcut: StandardKey.Copy + } + + Shortcut { + id: indirectShortcut + sequence: action.shortcut + } + + Shortcut { + id: directShortcut + sequence: StandardKey.Copy + } + + property alias indirect: indirectShortcut; + property alias direct: directShortcut + } + } + + function test_shortcutBinding() { + var container = createTemporaryObject(shortcutBinding, testCase); + verify(container) + compare(container.indirect.nativeText, container.direct.nativeText); + } } -- cgit v1.2.3 From 4259e99c1990dc88632b85d945e9093cca47a831 Mon Sep 17 00:00:00 2001 From: Kavindra Palaraja Date: Mon, 20 May 2019 16:12:40 +0200 Subject: doc - use the correct attributions file Change-Id: Ib83e2ec925e0c37b40562aea7f11e09759ce3abc Reviewed-by: Kai Koehne --- src/imports/controls/doc/src/qtquickcontrols2-index.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc index f95db512..a76eca6a 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc @@ -140,7 +140,7 @@ Furthermore Qt Quick Controls 2 potentially contains third party modules under following permissive licenses: - \generatelist{groupsbymodule attributions-qtquickcontrols2} + \generatelist{groupsbymodule attributions-qtquickcontrols} \section1 Topics -- cgit v1.2.3 From e23d4b68f3f3b1467f032e4ce3501dab0feb5fee Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 17 May 2019 16:51:12 +0300 Subject: Material: account for accent color in flat highlighted button's ripple According to https://material.io/design/components/buttons.html#text-button Change-Id: Ia36a676864a8f738d204cf8db9430b797f1f2f99 Reviewed-by: Mitch Curtis --- src/imports/controls/material/Button.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index 6f7d6c70..04c6664c 100644 --- a/src/imports/controls/material/Button.qml +++ b/src/imports/controls/material/Button.qml @@ -78,7 +78,6 @@ T.Button { control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground } - // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state background: Rectangle { implicitWidth: 64 implicitHeight: control.Material.buttonHeight @@ -113,7 +112,7 @@ T.Button { pressed: control.pressed anchor: control active: control.down || control.visualFocus || control.hovered - color: control.Material.rippleColor + color: control.flat && control.highlighted ? control.Material.highlightedRippleColor : control.Material.rippleColor } } } -- cgit v1.2.3 From 33e590ea30931306e055fe4a6ae38da8b3fe3d0c Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 23 May 2019 11:18:30 +0200 Subject: Bump version Change-Id: If3c56e80803135ac7e1ce99033da8e3dd09ad7a9 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 953a3db2..ec455bc4 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH QQC2_SOURCE_TREE = $$PWD -MODULE_VERSION = 5.12.3 +MODULE_VERSION = 5.12.4 -- cgit v1.2.3 From 783bfd2182f667817213faf3f54a285057bd2456 Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Thu, 23 May 2019 15:20:41 +0300 Subject: Add changes file for Qt 5.12.4 Change-Id: I2389ce274d609c13055e82408f38d30c6e921e5c Reviewed-by: Mitch Curtis --- dist/changes-5.12.4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 dist/changes-5.12.4 diff --git a/dist/changes-5.12.4 b/dist/changes-5.12.4 new file mode 100644 index 00000000..a285cd8e --- /dev/null +++ b/dist/changes-5.12.4 @@ -0,0 +1,20 @@ +Qt 5.12.4 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.3. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. -- cgit v1.2.3 From 761df2ced0081905b4238c66783bb276f504cf3d Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 13 Jun 2019 11:56:45 +0200 Subject: Accessibility: Switch should have checkbox as role Fixes: QTBUG-76356 Change-Id: I8f8e8331adbe741be2c893f2140d793d1b901434 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickabstractbutton.cpp | 4 ++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index a2992191..0aa8ec28 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -1157,6 +1157,10 @@ void QQuickAbstractButton::accessibilityActiveChanged(bool active) QAccessible::Role QQuickAbstractButton::accessibleRole() const { + Q_D(const QQuickAbstractButton); + if (d->checkable) { + return QAccessible::CheckBox; + } return QAccessible::Button; } #endif diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 0224f020..868b4413 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -100,7 +100,7 @@ void tst_accessibility::a11y_data() QTest::newRow("StackView") << "stackview" << QAccessible::LayeredPane << ""; QTest::newRow("SwipeDelegate") << "swipedelegate" << QAccessible::ListItem << "SwipeDelegate"; QTest::newRow("SwipeView") << "swipeview" << QAccessible::PageTabList << ""; - QTest::newRow("Switch") << "switch" << QAccessible::Button << "Switch"; + QTest::newRow("Switch") << "switch" << QAccessible::CheckBox << "Switch"; QTest::newRow("SwitchDelegate") << "switchdelegate" << QAccessible::ListItem << "SwitchDelegate"; QTest::newRow("TabBar") << "tabbar" << QAccessible::PageTabList << ""; QTest::newRow("TabButton") << "tabbutton" << QAccessible::PageTab << "TabButton"; -- cgit v1.2.3 From 2ea51ddea2b903d8115648a89d56b1e4b551e660 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 13 Jun 2019 17:55:17 +0200 Subject: Accessibility: Remove redundant checkbox role code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To make switch work, the base class now returns checkbox when it has the checkable property. With that change, this is no longer needed. Change-Id: I41d8f774cb244f922b859fd9f2dde75913e965b6 Reviewed-by: Jan Arve Sæther --- src/quicktemplates2/qquickcheckbox.cpp | 7 ------- src/quicktemplates2/qquickcheckbox_p.h | 4 ---- 2 files changed, 11 deletions(-) diff --git a/src/quicktemplates2/qquickcheckbox.cpp b/src/quicktemplates2/qquickcheckbox.cpp index 461fae30..0227e95d 100644 --- a/src/quicktemplates2/qquickcheckbox.cpp +++ b/src/quicktemplates2/qquickcheckbox.cpp @@ -243,13 +243,6 @@ void QQuickCheckBox::nextCheckState() QQuickAbstractButton::nextCheckState(); } -#if QT_CONFIG(accessibility) -QAccessible::Role QQuickCheckBox::accessibleRole() const -{ - return QAccessible::CheckBox; -} -#endif - QT_END_NAMESPACE #include "moc_qquickcheckbox_p.cpp" diff --git a/src/quicktemplates2/qquickcheckbox_p.h b/src/quicktemplates2/qquickcheckbox_p.h index 81bd680c..f0293c11 100644 --- a/src/quicktemplates2/qquickcheckbox_p.h +++ b/src/quicktemplates2/qquickcheckbox_p.h @@ -84,10 +84,6 @@ protected: void buttonChange(ButtonChange change) override; void nextCheckState() override; -#if QT_CONFIG(accessibility) - QAccessible::Role accessibleRole() const override; -#endif - private: Q_DISABLE_COPY(QQuickCheckBox) Q_DECLARE_PRIVATE(QQuickCheckBox) -- cgit v1.2.3 From 48f587be28e8b46e93703d7a4393b915b224495f Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 18 Jun 2019 12:49:23 +0200 Subject: Doc: Add specs about focus property Task-number: QTBUG-75546 Change-Id: I6e672c3a8390c4cf10dc9576cc3bf1eb10a6246b Reviewed-by: Paul Wicking --- src/quicktemplates2/qquickmenu.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp index aa44e845..82cc063f 100644 --- a/src/quicktemplates2/qquickmenu.cpp +++ b/src/quicktemplates2/qquickmenu.cpp @@ -173,6 +173,19 @@ static const int SUBMENU_DELAY = 225; \sa {Customizing Menu}, MenuItem, {Menu Controls}, {Popup Controls} */ +/*! + \qmlproperty bool QtQuick.Controls::Menu::focus + + This property holds whether the popup wants focus. + + When the popup actually receives focus, \l activeFocus will be \c true. + For more information, see \l {Keyboard Focus in Qt Quick}. + + The default value is \c false. + + \sa activeFocus +*/ + static const QQuickPopup::ClosePolicy cascadingSubMenuClosePolicy = QQuickPopup::CloseOnEscape | QQuickPopup::CloseOnPressOutsideParent; static bool shouldCascade() -- cgit v1.2.3 From 188773bd1383883cd7247b6ded0d0b1a41689155 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 18 Jun 2019 14:00:33 +0200 Subject: Doc: correct name of property in snippet Task-number: QTBUG-75558 Change-Id: Ic9856c6f6da4e0beefe2fe6f1bbaea8fdd67ea0d Reviewed-by: Paul Wicking --- src/quicktemplates2/qquickaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quicktemplates2/qquickaction.cpp b/src/quicktemplates2/qquickaction.cpp index 033173f8..9120db37 100644 --- a/src/quicktemplates2/qquickaction.cpp +++ b/src/quicktemplates2/qquickaction.cpp @@ -487,7 +487,7 @@ void QQuickAction::setCheckable(bool checkable) \code Action { - sequence: "Ctrl+E,Ctrl+W" + shortcut: "Ctrl+E,Ctrl+W" onTriggered: edit.wrapMode = TextEdit.Wrap } \endcode -- cgit v1.2.3 From bb88d84475f7c4bb69528da5096f4d2c91667a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Wed, 22 May 2019 15:40:06 +0200 Subject: Add a test for having a ShaderEffect as a delegate Change-Id: If4f3dca99638015b479509e4aa73e0190b1182ac Task-number: QTBUG-67343 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_combobox.qml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 0d266e1a..f8f06679 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -96,6 +96,45 @@ TestCase { } } + Component { + id: comboBoxWithShaderEffect + ComboBox { + delegate: Rectangle { + Text { + id: txt + anchors.centerIn: parent + text: "item" + index + font.pixelSize: 20 + color: "red" + } + id: rect + objectName: "rect" + width: parent.width + height: txt.implicitHeight + gradient: Gradient { + GradientStop { color: "lightsteelblue"; position: 0.0 } + GradientStop { color: "blue"; position: 1.0 } + } + layer.enabled: true + layer.effect: ShaderEffect { + objectName: "ShaderFX" + width: rect.width + height: rect.height + fragmentShader: " + uniform lowp sampler2D source; // this item + uniform lowp float qt_Opacity; // inherited opacity of this item + varying highp vec2 qt_TexCoord0; + void main() { + lowp vec4 p = texture2D(source, qt_TexCoord0); + lowp float g = dot(p.xyz, vec3(0.344, 0.5, 0.156)); + gl_FragColor = vec4(g, g, g, p.a) * qt_Opacity; + }" + + } + } + } + } + function init() { // QTBUG-61225: Move the mouse away to avoid QQuickWindowPrivate::flushFrameSynchronousEvents() // delivering interfering hover events based on the last mouse position from earlier tests. For @@ -1731,4 +1770,23 @@ TestCase { closedSpy.wait() compare(closedSpy.count, 1) } + + function test_comboBoxWithShaderEffect() { + var control = createTemporaryObject(comboBoxWithShaderEffect, testCase, {model: 9}) + verify(control) + waitForRendering(control) + control.forceActiveFocus() + var openedSpy = signalSpy.createObject(control, {target: control.popup, signalName: "opened"}) + verify(openedSpy.valid) + + var closedSpy = signalSpy.createObject(control, {target: control.popup, signalName: "closed"}) + verify(closedSpy.valid) + + control.popup.open() + openedSpy.wait() + compare(openedSpy.count, 1) + control.popup.close() + closedSpy.wait() + compare(closedSpy.count, 1) + } } -- cgit v1.2.3 From 3574033d526c0a78236148354e1f48d7b9aafe10 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 1 Jul 2019 16:02:53 +0200 Subject: Bump version Change-Id: I3d0cfbbd68b361f006a455e46e17e0da28823373 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index ec455bc4..215a1cc7 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH QQC2_SOURCE_TREE = $$PWD -MODULE_VERSION = 5.12.4 +MODULE_VERSION = 5.12.5 -- cgit v1.2.3 From ce7c431fb23157fa5125d1102a594de045818a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Thu, 27 Jun 2019 16:55:41 +0200 Subject: Fix crash in QQuickContainerPrivate::removeItem The count variable should be updated after removing the item. Fixes: QTBUG-76164 Change-Id: I141d720ffaa890002d98a7d2448adca9a7d7d2f3 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontainer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp index 8314230c..609c2079 100644 --- a/src/quicktemplates2/qquickcontainer.cpp +++ b/src/quicktemplates2/qquickcontainer.cpp @@ -306,6 +306,7 @@ void QQuickContainerPrivate::removeItem(int index, QQuickItem *item) QQuickItemPrivate::get(item)->removeItemChangeListener(this, changeTypes); item->setParentItem(nullptr); contentModel->remove(index); + --count; q->itemRemoved(index, item); -- cgit v1.2.3