diff options
author | Liang Qi <liang.qi@qt.io> | 2019-07-04 13:35:55 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-07-04 13:35:55 +0200 |
commit | 5211cf2843af606b912e9130d44ee6c82eeb40b0 (patch) | |
tree | d2a90e480d497edc3bbac367bf974ec93076e409 /src | |
parent | 13bdd61c6597586f62558ca337c193ce03db26cc (diff) | |
parent | ce7c431fb23157fa5125d1102a594de045818a72 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
.qmake.conf
tests/auto/accessibility/tst_accessibility.cpp
Change-Id: I0bc187e2a8edb4e357c1bf114dd9b1977d5c1e45
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/doc/qtquickcontrols.qdocconf | 4 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtquickcontrols2-index.qdoc | 2 | ||||
-rw-r--r-- | src/imports/controls/material/Button.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/material/CursorDelegate.qml | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickaction.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcheckbox.cpp | 7 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcheckbox_p.h | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcontainer.cpp | 5 | ||||
-rw-r--r-- | src/quicktemplates2/qquickmenu.cpp | 13 | ||||
-rw-r--r-- | src/quicktemplates2/qquickrangeslider.cpp | 29 | ||||
-rw-r--r-- | src/quicktemplates2/qquickscrollview.cpp | 3 |
12 files changed, 43 insertions, 37 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/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc index d425f421..452afb18 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 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 } } } 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 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/src/quicktemplates2/qquickaction.cpp b/src/quicktemplates2/qquickaction.cpp index e83fd353..9120db37 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); @@ -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 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) diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp index 2c357f82..609c2079 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; @@ -305,10 +306,10 @@ void QQuickContainerPrivate::removeItem(int index, QQuickItem *item) QQuickItemPrivate::get(item)->removeItemChangeListener(this, changeTypes); item->setParentItem(nullptr); contentModel->remove(index); + --count; q->itemRemoved(index, item); - int count = contentModel->count(); for (int i = index; i < count; ++i) q->itemMoved(i, itemAt(i)); 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() 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 { @@ -818,6 +811,17 @@ QQuickRangeSliderNode *QQuickRangeSlider::first() const } /*! + \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 \qmlproperty real QtQuick.Controls::RangeSlider::second.position @@ -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. |