aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-07-04 13:35:55 +0200
committerLiang Qi <liang.qi@qt.io>2019-07-04 13:35:55 +0200
commit5211cf2843af606b912e9130d44ee6c82eeb40b0 (patch)
treed2a90e480d497edc3bbac367bf974ec93076e409 /src/quicktemplates2
parent13bdd61c6597586f62558ca337c193ce03db26cc (diff)
parentce7c431fb23157fa5125d1102a594de045818a72 (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/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp4
-rw-r--r--src/quicktemplates2/qquickaction.cpp4
-rw-r--r--src/quicktemplates2/qquickcheckbox.cpp7
-rw-r--r--src/quicktemplates2/qquickcheckbox_p.h4
-rw-r--r--src/quicktemplates2/qquickcontainer.cpp5
-rw-r--r--src/quicktemplates2/qquickmenu.cpp13
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp29
-rw-r--r--src/quicktemplates2/qquickscrollview.cpp3
8 files changed, 37 insertions, 32 deletions
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.