summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2016-01-09 19:58:06 +0000
committerSérgio Martins <iamsergio@gmail.com>2016-01-10 12:49:00 +0000
commit1bbf7fb4e39fd1382e3956e2bb5fbebaca01cf53 (patch)
treeb3115e46c4f55134b06f5b0d43542a265db6d54e
parent000c4358ceca78dc962a8ac287afdbb54e8b9837 (diff)
Fix a few container detachments
Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp2
-rw-r--r--src/widgets/util/qcompleter.cpp6
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index d71297bd60..05ccff5de0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4193,7 +4193,7 @@ protected:
void QGradientCache::generateGradientColorTable(const QGradient& gradient, QRgba64 *colorTable, int size, int opacity) const
{
- QGradientStops stops = gradient.stops();
+ const QGradientStops stops = gradient.stops();
int stopCount = stops.count();
Q_ASSERT(stopCount > 0);
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index a1c2aebbe6..2ddd025239 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -203,7 +203,7 @@ int QDesktopWidget::screenNumber(const QWidget *w) const
return primaryScreen();
// If there is more than one virtual desktop
- if (screens.count() != screens.first()->virtualSiblings().count()) {
+ if (screens.count() != screens.constFirst()->virtualSiblings().count()) {
// Find the root widget, get a QScreen from it and use the
// virtual siblings for checking the window position.
const QWidget *root = w;
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index ba56f004b7..4382abaf50 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -432,7 +432,7 @@ void QCompletionEngine::filter(const QStringList& parts)
QModelIndex parent;
for (int i = 0; i < curParts.count() - 1; i++) {
- QString part = curParts[i];
+ QString part = curParts.at(i);
int emi = filter(part, parent, -1).exactMatchIndex;
if (emi == -1)
return;
@@ -442,10 +442,10 @@ void QCompletionEngine::filter(const QStringList& parts)
// Note that we set the curParent to a valid parent, even if we have no matches
// When filtering is disabled, we show all the items under this parent
curParent = parent;
- if (curParts.last().isEmpty())
+ if (curParts.constLast().isEmpty())
curMatch = QMatchData(QIndexMapper(0, model->rowCount(curParent) - 1), -1, false);
else
- curMatch = filter(curParts.last(), curParent, 1); // build at least one
+ curMatch = filter(curParts.constLast(), curParent, 1); // build at least one
curRow = curMatch.isValid() ? 0 : -1;
}
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 5b6bfb3b3c..4d2c32d43e 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -261,7 +261,7 @@ void QDialogButtonBoxPrivate::layoutButtons()
if (center)
buttonLayout->addStretch();
- QList<QAbstractButton *> acceptRoleList = buttonLists[QPlatformDialogHelper::AcceptRole];
+ const QList<QAbstractButton *> &acceptRoleList = buttonLists[QPlatformDialogHelper::AcceptRole];
while (*currentLayout != QPlatformDialogHelper::EOL) {
int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);