Fix warning: "Don't call QList::last() on temporary"

[-Wclazy-detaching-temporary]

Change-Id: I5e06e44fc45c80ea1dca518611d4f0c28a738061
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Alessandro Portale
2019-01-17 01:59:27 +01:00
parent 5f5e82b0b6
commit c82d2cbd54
3 changed files with 4 additions and 4 deletions

View File

@@ -350,7 +350,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
CPlusPlus::Overview overview;
parameters.prettySymbolName = overview.prettyName(context.path(symbol).last());
parameters.prettySymbolName = overview.prettyName(context.path(symbol).constLast());
}
search->setUserData(qVariantFromValue(parameters));

View File

@@ -309,8 +309,8 @@ void QuickToolBar::setProperty(const QString &propertyName, const QVariant &valu
int column;
int changeSetPos = changeSet.operationList().last().pos1;
int changeSetLength = changeSet.operationList().last().text.length();
int changeSetPos = changeSet.operationList().constLast().pos1;
int changeSetLength = changeSet.operationList().constLast().text.length();
QTextCursor tc = m_editorWidget->textCursor();
tc.beginEditBlock();
changeSet.apply(&tc);

View File

@@ -479,7 +479,7 @@ void Parser::Private::parseCostItem(const char *begin, const char *end)
const CostItem *lastCostItem = nullptr;
if (!currentFunction->costItems().isEmpty())
lastCostItem = currentFunction->costItems().last();
lastCostItem = currentFunction->costItems().constLast();
// parse positions ("where")
for (int i = 0; i < addressValuesCount; ++i) {