Skip to content

Commit

Permalink
Fix a few container detachments
Browse files Browse the repository at this point in the history
Change-Id: I018a1fe4bdbbe42b683793d7ddbf19f464d6e3b0
Reviewed-by: Marc Mutz <[email protected]>
  • Loading branch information
iamsergio committed Jan 10, 2016
1 parent 000c435 commit 1bbf7fb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gui/painting/qpaintengine_raster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4193,7 +4193,7 @@ class QGradientCache

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);

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/kernel/qdesktopwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/util/qcompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/widgets/widgets/qdialogbuttonbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1bbf7fb

Please sign in to comment.