Use QVector instead of QList for sizeof(T) > sizeof(void*)

caught with static analyzer which only warns for trivial cases:
- Container must be local
- Container isn't passed to any function, assigned to another
container or assigned to.

Change-Id: I3f3aa73c128a56f067fa8745990977445a495ac4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Sérgio Martins 2016-01-24 11:05:42 +00:00 committed by Sérgio Martins
parent 6139fbeb5f
commit e41e034669
3 changed files with 3 additions and 3 deletions

View File

@ -476,7 +476,7 @@ QByteArray QSpdyProtocolHandler::composeHeader(const QHttpNetworkRequest &reques
// calculate additional headers first, because we need to know the size
// ### do not partially copy the list, but restrict the set header fields
// in QHttpNetworkConnection
QList<QPair<QByteArray, QByteArray> > additionalHeaders;
QVector<QPair<QByteArray, QByteArray> > additionalHeaders;
for (int a = 0; a < request.header().count(); ++a) {
QByteArray key = request.header().at(a).first;
if (key == "Connection" || key == "Host" || key == "Keep-Alive"

View File

@ -3452,7 +3452,7 @@ void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text)
const QStringList multipleFiles = typedFiles();
if (multipleFiles.count() > 0) {
QModelIndexList oldFiles = qFileDialogUi->listView->selectionModel()->selectedRows();
QModelIndexList newFiles;
QVector<QModelIndex> newFiles;
for (const auto &file : multipleFiles) {
QModelIndex idx = model->index(file);
if (oldFiles.removeAll(idx) == 0)

View File

@ -568,7 +568,7 @@ void QColumnViewPrivate::closeColumns(const QModelIndex &parent, bool build)
bool clearAll = !parent.isValid();
bool passThroughRoot = false;
QList<QModelIndex> dirsToAppend;
QVector<QModelIndex> dirsToAppend;
// Find the last column that matches the parent's tree
int currentColumn = -1;