diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-25 12:39:58 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-11-25 12:45:06 +0000 |
commit | 2bd4f5cd587e258227c69b3124757d7b8e019c9f (patch) | |
tree | 6a7cf839b51658b0ca527c57cf0af155a95c4fc7 /src/quickcontrols2 | |
parent | 864eada35653075f49e8b683ba3fd7fdf3f38256 (diff) | |
parent | e57f66dc77985eae1023da526ef39d6b3e040255 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I61919fabd4a3a07ed374f2c3c1fae2d589d6e124
Diffstat (limited to 'src/quickcontrols2')
-rw-r--r-- | src/quickcontrols2/qquickattachedobject.cpp | 2 | ||||
-rw-r--r-- | src/quickcontrols2/qquickiconlabel.cpp | 2 | ||||
-rw-r--r-- | src/quickcontrols2/qquickiconlabel_p.h | 2 | ||||
-rw-r--r-- | src/quickcontrols2/qquickstyle.cpp | 2 | ||||
-rw-r--r-- | src/quickcontrols2/qquicktumblerview.cpp | 3 |
5 files changed, 6 insertions, 5 deletions
diff --git a/src/quickcontrols2/qquickattachedobject.cpp b/src/quickcontrols2/qquickattachedobject.cpp index c43f7dc5..722f22f9 100644 --- a/src/quickcontrols2/qquickattachedobject.cpp +++ b/src/quickcontrols2/qquickattachedobject.cpp @@ -119,7 +119,7 @@ static QList<QQuickAttachedObject *> findAttachedChildren(const QMetaObject *typ if (window) { item = window->contentItem(); - const auto windowChildren = window->children(); + const auto &windowChildren = window->children(); for (QObject *child : windowChildren) { QQuickWindow *childWindow = qobject_cast<QQuickWindow *>(child); if (childWindow) { diff --git a/src/quickcontrols2/qquickiconlabel.cpp b/src/quickcontrols2/qquickiconlabel.cpp index b246621b..536b3c1b 100644 --- a/src/quickcontrols2/qquickiconlabel.cpp +++ b/src/quickcontrols2/qquickiconlabel.cpp @@ -408,7 +408,7 @@ QString QQuickIconLabel::text() const return d->text; } -void QQuickIconLabel::setText(const QString text) +void QQuickIconLabel::setText(const QString &text) { Q_D(QQuickIconLabel); if (d->text == text) diff --git a/src/quickcontrols2/qquickiconlabel_p.h b/src/quickcontrols2/qquickiconlabel_p.h index df79dbf2..75b77064 100644 --- a/src/quickcontrols2/qquickiconlabel_p.h +++ b/src/quickcontrols2/qquickiconlabel_p.h @@ -88,7 +88,7 @@ public: void setIcon(const QQuickIcon &icon); QString text() const; - void setText(const QString text); + void setText(const QString &text); QFont font() const; void setFont(const QFont &font); diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index e2b6678b..408a0de3 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -495,7 +495,7 @@ static bool qt_is_dark_system_theme() { if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { if (const QPalette *systemPalette = theme->palette(QPlatformTheme::SystemPalette)) { - const QColor textColor = systemPalette->color(QPalette::WindowText); + const QColor &textColor = systemPalette->color(QPalette::WindowText); return textColor.red() > 128 && textColor.blue() > 128 && textColor.green() > 128; } } diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp index 5f5c065d..4a64ad7f 100644 --- a/src/quickcontrols2/qquicktumblerview.cpp +++ b/src/quickcontrols2/qquicktumblerview.cpp @@ -180,7 +180,6 @@ void QQuickTumblerView::createView() QQml_setParent_noEvent(m_listView, this); m_listView->setParentItem(this); m_listView->setSnapMode(QQuickListView::SnapToItem); - m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); m_listView->setClip(true); // Give the view a size. @@ -193,6 +192,8 @@ void QQuickTumblerView::createView() // the view animates any potential currentIndex change over one second, // which we don't want when the contentItem has just been created. m_listView->setDelegate(m_delegate); + // Set this after setting the delegate to avoid unexpected currentIndex changes: QTBUG-79150 + m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); m_listView->setHighlightMoveDuration(1000); qCDebug(lcTumblerView) << "finished creating ListView"; |