From bdf2d7e0af79b0975fd5392d3b3248cb17989798 Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 12 Apr 2016 18:35:45 +0300 Subject: QStringListModel: proper construction of vector ... with known size and known value by corresponding ctor. Don't use appending for this case. Change-Id: I70f5b943cda7e55eeb45becf439f79c9aee77278 Reviewed-by: Edward Welbourne Reviewed-by: Marc Mutz --- src/corelib/itemmodels/qstringlistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/itemmodels') diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index 1a1b2b9fb6..f70c318ff7 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -187,7 +187,7 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value, if (index.row() >= 0 && index.row() < lst.size() && (role == Qt::EditRole || role == Qt::DisplayRole)) { lst.replace(index.row(), value.toString()); - emit dataChanged(index, index, QVector() << role); + emit dataChanged(index, index, QVector(1, role)); return true; } return false; -- cgit v1.2.3