diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-07-17 03:00:30 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-07-17 09:45:48 +0000 |
commit | d96bd6069c6d24c12f0a3d96466e50b4d1a09ac4 (patch) | |
tree | b1250acd86c482fc92cd90d1733f0a436d1c2a78 /src/quicktemplates2 | |
parent | 1567e4581e1f82dae011d6d3b2e4196efc93b0f4 (diff) | |
parent | 449c9c2474da0461c14e7d6ea12ff4e35c3c7aae (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/quickcontrols2/qquickstyle.cpp
src/quicktemplates2/qquickscrollview.cpp
tests/auto/qquickstyle/tst_qquickstyle.cpp
Change-Id: I9afddf07a956f43cf0445e91b8d1a02f167b6bd5
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 1 | ||||
-rw-r--r-- | src/quicktemplates2/qquickoverlay.cpp | 10 | ||||
-rw-r--r-- | src/quicktemplates2/qquickscrollview.cpp | 14 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktumbler.cpp | 19 | ||||
-rw-r--r-- | src/quicktemplates2/qquicktumbler_p_p.h | 1 |
5 files changed, 38 insertions, 7 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index dd38b80e..c0ce6978 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -754,6 +754,7 @@ void QQuickAbstractButton::setIcon(const QQuickIcon &icon) \row \li \c AbstractButton.IconOnly \li \image qtquickcontrols2-button-icononly.png \row \li \c AbstractButton.TextOnly \li \image qtquickcontrols2-button-textonly.png \row \li \c AbstractButton.TextBesideIcon \li \image qtquickcontrols2-button-textbesideicon.png + \row \li \c AbstractButton.TextUnderIcon \li \image qtquickcontrols2-button-textundericon.png \endtable \sa {Control::}{spacing}, {Control::}{padding} diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 43dfa682..cf72c8a6 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -643,6 +643,11 @@ QQuickOverlay *QQuickOverlayAttached::overlay() const The property can be attached to any popup. + For example, to change the color of the background dimming for a modal + popup, the following code can be used: + + \snippet qtquickcontrols2-overlay-modal.qml 1 + \sa Popup::modal */ QQmlComponent *QQuickOverlayAttached::modal() const @@ -671,6 +676,11 @@ void QQuickOverlayAttached::setModal(QQmlComponent *modal) The property can be attached to any popup. + For example, to change the color of the background dimming for a modeless + popup, the following code can be used: + + \snippet qtquickcontrols2-overlay-modeless.qml 1 + \sa Popup::dim */ QQmlComponent *QQuickOverlayAttached::modeless() const diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index 1d7ecfad..abd75d31 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -70,6 +70,20 @@ QT_BEGIN_NAMESPACE \snippet qtquickcontrols2-scrollview-listview.qml file + \section2 Sizing + + As with Flickable, there are several things to keep in mind when using + ScrollView: + \list + \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 + 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. + \endlist + \section2 Scroll Bars The horizontal and vertical scroll bars can be accessed and customized using diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp index 75520375..25710231 100644 --- a/src/quicktemplates2/qquicktumbler.cpp +++ b/src/quicktemplates2/qquicktumbler.cpp @@ -215,7 +215,7 @@ void QQuickTumblerPrivate::_q_onViewCountChanged() // If we could successfully set the currentIndex, consider it done. // Otherwise, we'll try again later in updatePolish(). if (currentIndex == pendingCurrentIndex) - pendingCurrentIndex = -1; + setPendingCurrentIndex(-1); else q->polish(); } else if (currentIndex == -1) { @@ -639,7 +639,7 @@ void QQuickTumblerPrivate::syncCurrentIndex() // Nothing to do. if (actualViewIndex == indexToSet) { - pendingCurrentIndex = -1; + setPendingCurrentIndex(-1); return; } @@ -652,11 +652,16 @@ void QQuickTumblerPrivate::syncCurrentIndex() ignoreCurrentIndexChanges = false; if (view->property("currentIndex").toInt() == indexToSet) - pendingCurrentIndex = -1; + setPendingCurrentIndex(-1); else if (isPendingCurrentIndex) q->polish(); } +void QQuickTumblerPrivate::setPendingCurrentIndex(int index) +{ + pendingCurrentIndex = index; +} + void QQuickTumblerPrivate::setCurrentIndex(int newCurrentIndex, QQuickTumblerPrivate::PropertyChangeReason changeReason) { @@ -666,7 +671,7 @@ void QQuickTumblerPrivate::setCurrentIndex(int newCurrentIndex, if (!q->isComponentComplete()) { // Views can't set currentIndex until they're ready. - pendingCurrentIndex = newCurrentIndex; + setPendingCurrentIndex(newCurrentIndex); return; } @@ -675,7 +680,7 @@ void QQuickTumblerPrivate::setCurrentIndex(int newCurrentIndex, // the model is in the process of being set and the user has set // the currentIndex in onModelChanged. We have to queue the currentIndex // change until we're ready. - pendingCurrentIndex = newCurrentIndex; + setPendingCurrentIndex(newCurrentIndex); return; } @@ -814,7 +819,7 @@ void QQuickTumbler::updatePolish() // If the count is still 0, it's not going to happen. if (d->count == 0) { - d->pendingCurrentIndex = -1; + d->setPendingCurrentIndex(-1); return; } @@ -829,7 +834,7 @@ void QQuickTumbler::updatePolish() d->setCurrentIndex(0); } - d->pendingCurrentIndex = -1; + d->setPendingCurrentIndex(-1); } } diff --git a/src/quicktemplates2/qquicktumbler_p_p.h b/src/quicktemplates2/qquicktumbler_p_p.h index 2f8b1207..75c6cd1b 100644 --- a/src/quicktemplates2/qquicktumbler_p_p.h +++ b/src/quicktemplates2/qquicktumbler_p_p.h @@ -104,6 +104,7 @@ public: void setupViewData(QQuickItem *newControlContentItem); void warnAboutIncorrectContentItem(); void syncCurrentIndex(); + void setPendingCurrentIndex(int index); enum PropertyChangeReason { UserChange, |