aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols2')
-rw-r--r--src/quickcontrols2/qquickattachedobject.cpp6
-rw-r--r--src/quickcontrols2/qquickiconlabel.cpp2
-rw-r--r--src/quickcontrols2/qquickiconlabel_p.h2
-rw-r--r--src/quickcontrols2/qquickmnemoniclabel.cpp2
-rw-r--r--src/quickcontrols2/qquickstyle.cpp2
-rw-r--r--src/quickcontrols2/qquicktumblerview.cpp3
6 files changed, 9 insertions, 8 deletions
diff --git a/src/quickcontrols2/qquickattachedobject.cpp b/src/quickcontrols2/qquickattachedobject.cpp
index 8b75e42a..722f22f9 100644
--- a/src/quickcontrols2/qquickattachedobject.cpp
+++ b/src/quickcontrols2/qquickattachedobject.cpp
@@ -48,8 +48,8 @@ static QQuickAttachedObject *attachedObject(const QMetaObject *type, QObject *ob
{
if (!object)
return nullptr;
- int idx = -1;
- return qobject_cast<QQuickAttachedObject *>(qmlAttachedPropertiesObject(&idx, object, type, create));
+ auto func = qmlAttachedPropertiesFunction(object, type);
+ return qobject_cast<QQuickAttachedObject *>(qmlAttachedPropertiesObject(object, func, create));
}
static QQuickAttachedObject *findAttachedParent(const QMetaObject *type, QObject *object)
@@ -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/qquickmnemoniclabel.cpp b/src/quickcontrols2/qquickmnemoniclabel.cpp
index a006f076..193365b5 100644
--- a/src/quickcontrols2/qquickmnemoniclabel.cpp
+++ b/src/quickcontrols2/qquickmnemoniclabel.cpp
@@ -88,7 +88,7 @@ static QTextLayout::FormatRange underlineRange(int start, int length = 1)
// based on QPlatformTheme::removeMnemonics()
void QQuickMnemonicLabel::updateMnemonic()
{
- QString text(m_fullText.size(), 0);
+ QString text(m_fullText.size(), QChar::Null);
int idx = 0;
int pos = 0;
int len = m_fullText.length();
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";