Use QList instead of QVector in corelib implementation

Omitting state machine and docs for now.

Task-number: QTBUG-84469
Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
Jarek Kobus 2020-06-26 08:21:15 +02:00
parent be1bb19295
commit b0f9c06a9b
55 changed files with 334 additions and 388 deletions

View File

@ -389,7 +389,7 @@ void QVariantAnimation::setEasingCurve(const QEasingCurve &easing)
d->recalculateCurrentInterval();
}
typedef QVector<QVariantAnimation::Interpolator> QInterpolatorVector;
typedef QList<QVariantAnimation::Interpolator> QInterpolatorVector;
Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators)
static QBasicMutex registeredInterpolatorsMutex;
@ -571,7 +571,7 @@ QVariant QVariantAnimation::keyValueAt(qreal step) const
/*!
\typedef QVariantAnimation::KeyValues
This is a typedef for QVector<KeyValue>
This is a typedef for QList<KeyValue>
*/
/*!

View File

@ -40,7 +40,6 @@
#include "qplatformdefs.h"
#include "qstring.h"
#include "qvector.h"
#include "qlist.h"
#include "qdir.h"
#include "qdatetime.h"
@ -4267,7 +4266,7 @@ bool qunsetenv(const char *varName)
*/
struct QInternal_CallBackTable {
QVector<QList<qInternalCallback> > callbacks;
QList<QList<qInternalCallback>> callbacks;
};
Q_GLOBAL_STATIC(QInternal_CallBackTable, global_callback_table)

View File

@ -1088,7 +1088,7 @@ struct QMessagePattern {
QString backtraceSeparator;
int backtraceDepth;
};
QVector<BacktraceParams> backtraceArgs; // backtrace argumens in sequence of %{backtrace
QList<BacktraceParams> backtraceArgs; // backtrace argumens in sequence of %{backtrace
#endif
bool fromEnvironment;

View File

@ -790,7 +790,7 @@ inline QRandomGenerator::SystemGenerator &QRandomGenerator::SystemGenerator::sel
\snippet code/src_corelib_global_qrandom.cpp 8
If the range refers to contiguous memory (such as an array or the data from
a QVector), the fillRange() function may be used too.
a QList), the fillRange() function may be used too.
\sa fillRange()
*/

View File

@ -730,14 +730,6 @@ QDebug &QDebug::resetFormat()
support streaming into QDebug.
*/
/*!
\fn template <typename T> QDebug operator<<(QDebug debug, const QVector<T> &vec)
\relates QDebug
Writes the contents of vector \a vec to \a debug. \c T needs to
support streaming into QDebug.
*/
/*!
\fn template <typename T, typename Alloc> QDebug operator<<(QDebug debug, const std::vector<T, Alloc> &vec)
\relates QDebug

View File

@ -51,7 +51,6 @@
#if QT_CONFIG(regularexpression)
# include <qregularexpression.h>
#endif
#include "qvector.h"
#include "qvarlengtharray.h"
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"

View File

@ -142,7 +142,7 @@ public:
const QDirIterator::IteratorFlags iteratorFlags;
#if QT_CONFIG(regularexpression)
QVector<QRegularExpression> nameRegExps;
QList<QRegularExpression> nameRegExps;
#endif
QDirIteratorPrivateIteratorStack<QAbstractFileEngineIterator> fileEngineIterators;

View File

@ -47,12 +47,11 @@
#include <private/qsystemlibrary_p.h>
#include <qdebug.h>
#include "qfile.h"
#include "qdir.h"
#include "qvarlengtharray.h"
#include "qdatetime.h"
#include "qfile.h"
#include "qvarlengtharray.h"
#include "qt_windows.h"
#include "qvector.h"
#if QT_CONFIG(regularexpression)
#include "qregularexpression.h"
#endif

View File

@ -41,7 +41,6 @@
#include "qfilesystemengine_p.h"
#include "qoperatingsystemversion.h"
#include "qplatformdefs.h"
#include "qvector.h"
#include <QtCore/qt_windows.h>

View File

@ -648,7 +648,7 @@ void QWindowsFileSystemWatcherEngineThread::run()
{
auto locker = qt_unique_lock(mutex);
forever {
QVector<HANDLE> handlesCopy = handles;
QList<HANDLE> handlesCopy = handles;
locker.unlock();
DEBUG() << "QWindowsFileSystemWatcherThread" << this << "waiting on" << handlesCopy.count() << "handles";
DWORD r = WaitForMultipleObjects(handlesCopy.count(), handlesCopy.constData(), false, INFINITE);

View File

@ -283,7 +283,7 @@ static bool qtLoggingDebug()
return debugEnv;
}
static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)
static QList<QLoggingRule> loadRulesFromFile(const QString &filePath)
{
QFile file(filePath);
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
@ -295,7 +295,7 @@ static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)
parser.setContent(stream);
return parser.rules();
}
return QVector<QLoggingRule>();
return QList<QLoggingRule>();
}
/*!
@ -305,7 +305,7 @@ static QVector<QLoggingRule> loadRulesFromFile(const QString &filePath)
*/
void QLoggingRegistry::initializeRules()
{
QVector<QLoggingRule> er, qr, cr;
QList<QLoggingRule> er, qr, cr;
// get rules from environment
const QByteArray rulesFilePath = qgetenv("QT_LOGGING_CONF");
if (!rulesFilePath.isEmpty())

View File

@ -46,7 +46,7 @@
#include "qdebug.h"
#include "qlocale.h"
#include "qglobal.h"
#include "qvector.h"
#include "qlist.h"
#include "qdatetime.h"
#include "qbytearray.h"
#include "qstringlist.h"

View File

@ -124,7 +124,7 @@ namespace {
};
}
typedef QHash<int, Path> PathHash;
typedef QVector<QConfFileCustomFormat> CustomFormatVector;
typedef QList<QConfFileCustomFormat> CustomFormatVector;
Q_GLOBAL_STATIC(ConfFileHash, usedHashFunc)
Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc)
@ -1772,7 +1772,7 @@ bool QConfFileSettingsPrivate::writeIniFile(QIODevice &device, const ParsedSetti
}
const int sectionCount = iniMap.size();
QVector<QSettingsIniKey> sections;
QList<QSettingsIniKey> sections;
sections.reserve(sectionCount);
for (i = iniMap.constBegin(); i != iniMap.constEnd(); ++i)
sections.append(QSettingsIniKey(i.key(), i.value().position));

View File

@ -40,7 +40,7 @@
#include "qsettings.h"
#include "qsettings_p.h"
#include "qvector.h"
#include "qlist.h"
#include "qmap.h"
#include "qdebug.h"
#include <qt_windows.h>
@ -369,7 +369,7 @@ void RegistryKey::close()
m_handle = 0;
}
typedef QVector<RegistryKey> RegistryKeyList;
typedef QList<RegistryKey> RegistryKeyList;
/*******************************************************************************
** class QWinSettingsPrivate

View File

@ -44,7 +44,7 @@
#include <qsize.h>
#include <qmimedata.h>
#include <qdebug.h>
#include <qvector.h>
#include <qlist.h>
#if QT_CONFIG(regularexpression)
# include <qregularexpression.h>
#endif
@ -658,10 +658,9 @@ void QAbstractItemModelPrivate::rowsAboutToBeInserted(const QModelIndex &parent,
{
Q_Q(QAbstractItemModel);
Q_UNUSED(last);
QVector<QPersistentModelIndexData *> persistent_moved;
QList<QPersistentModelIndexData *> persistent_moved;
if (first < q->rowCount(parent)) {
for (auto it = persistent.indexes.constBegin(); it != persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(persistent.indexes)) {
const QModelIndex &index = data->index;
if (index.row() >= first && index.isValid() && index.parent() == parent) {
persistent_moved.append(data);
@ -674,11 +673,9 @@ void QAbstractItemModelPrivate::rowsAboutToBeInserted(const QModelIndex &parent,
void QAbstractItemModelPrivate::rowsInserted(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_moved.constBegin();
it != persistent_moved.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
const int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (auto *data : persistent_moved) {
QModelIndex old = data->index;
persistent.indexes.erase(persistent.indexes.constFind(old));
data->index = q_func()->index(old.row() + count, old.column(), parent);
@ -692,18 +689,14 @@ void QAbstractItemModelPrivate::rowsInserted(const QModelIndex &parent,
void QAbstractItemModelPrivate::itemsAboutToBeMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
{
QVector<QPersistentModelIndexData *> persistent_moved_explicitly;
QVector<QPersistentModelIndexData *> persistent_moved_in_source;
QVector<QPersistentModelIndexData *> persistent_moved_in_destination;
const auto begin = persistent.indexes.constBegin();
const auto end = persistent.indexes.constEnd();
QList<QPersistentModelIndexData *> persistent_moved_explicitly;
QList<QPersistentModelIndexData *> persistent_moved_in_source;
QList<QPersistentModelIndexData *> persistent_moved_in_destination;
const bool sameParent = (srcParent == destinationParent);
const bool movingUp = (srcFirst > destinationChild);
for (auto it = begin; it != end; ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(persistent.indexes)) {
const QModelIndex &index = data->index;
const QModelIndex &parent = index.parent();
const bool isSourceIndex = (parent == srcParent);
@ -754,16 +747,10 @@ void QAbstractItemModelPrivate::itemsAboutToBeMoved(const QModelIndex &srcParent
column value depending on the value of \a orientation. The indexes may also be moved to a different parent if \a parent
differs from the existing parent for the index.
*/
void QAbstractItemModelPrivate::movePersistentIndexes(const QVector<QPersistentModelIndexData *> &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation)
void QAbstractItemModelPrivate::movePersistentIndexes(const QList<QPersistentModelIndexData *> &indexes, int change,
const QModelIndex &parent, Qt::Orientation orientation)
{
QVector<QPersistentModelIndexData *>::const_iterator it;
const QVector<QPersistentModelIndexData *>::const_iterator begin = indexes.constBegin();
const QVector<QPersistentModelIndexData *>::const_iterator end = indexes.constEnd();
for (it = begin; it != end; ++it)
{
QPersistentModelIndexData *data = *it;
for (auto *data : indexes) {
int row = data->index.row();
int column = data->index.column();
@ -784,9 +771,9 @@ void QAbstractItemModelPrivate::movePersistentIndexes(const QVector<QPersistentM
void QAbstractItemModelPrivate::itemsMoved(const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation)
{
QVector<QPersistentModelIndexData *> moved_in_destination = persistent.moved.pop();
QVector<QPersistentModelIndexData *> moved_in_source = persistent.moved.pop();
QVector<QPersistentModelIndexData *> moved_explicitly = persistent.moved.pop();
const QList<QPersistentModelIndexData *> moved_in_destination = persistent.moved.pop();
const QList<QPersistentModelIndexData *> moved_in_source = persistent.moved.pop();
const QList<QPersistentModelIndexData *> moved_explicitly = persistent.moved.pop();
const bool sameParent = (sourceParent == destinationParent);
const bool movingUp = (sourceFirst > destinationChild);
@ -803,12 +790,11 @@ void QAbstractItemModelPrivate::itemsMoved(const QModelIndex &sourceParent, int
void QAbstractItemModelPrivate::rowsAboutToBeRemoved(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved;
QVector<QPersistentModelIndexData *> persistent_invalidated;
QList<QPersistentModelIndexData *> persistent_moved;
QList<QPersistentModelIndexData *> persistent_invalidated;
// find the persistent indexes that are affected by the change, either by being in the removed subtree
// or by being on the same level and below the removed rows
for (auto it = persistent.indexes.constBegin(); it != persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(persistent.indexes)) {
bool level_changed = false;
QModelIndex current = data->index;
while (current.isValid()) {
@ -832,11 +818,9 @@ void QAbstractItemModelPrivate::rowsAboutToBeRemoved(const QModelIndex &parent,
void QAbstractItemModelPrivate::rowsRemoved(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_moved.constBegin();
it != persistent_moved.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
const int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (auto *data : persistent_moved) {
QModelIndex old = data->index;
persistent.indexes.erase(persistent.indexes.constFind(old));
data->index = q_func()->index(old.row() - count, old.column(), parent);
@ -846,10 +830,8 @@ void QAbstractItemModelPrivate::rowsRemoved(const QModelIndex &parent,
qWarning() << "QAbstractItemModel::endRemoveRows: Invalid index (" << old.row() - count << ',' << old.column() << ") in model" << q_func();
}
}
QVector<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_invalidated.constBegin();
it != persistent_invalidated.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
for (auto *data : persistent_invalidated) {
auto pit = persistent.indexes.constFind(data->index);
if (pit != persistent.indexes.cend())
persistent.indexes.erase(pit);
@ -862,10 +844,9 @@ void QAbstractItemModelPrivate::columnsAboutToBeInserted(const QModelIndex &pare
{
Q_Q(QAbstractItemModel);
Q_UNUSED(last);
QVector<QPersistentModelIndexData *> persistent_moved;
QList<QPersistentModelIndexData *> persistent_moved;
if (first < q->columnCount(parent)) {
for (auto it = persistent.indexes.constBegin(); it != persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(persistent.indexes)) {
const QModelIndex &index = data->index;
if (index.column() >= first && index.isValid() && index.parent() == parent)
persistent_moved.append(data);
@ -877,11 +858,9 @@ void QAbstractItemModelPrivate::columnsAboutToBeInserted(const QModelIndex &pare
void QAbstractItemModelPrivate::columnsInserted(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_moved.constBegin();
it != persistent_moved.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
const int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (auto *data : persistent_moved) {
QModelIndex old = data->index;
persistent.indexes.erase(persistent.indexes.constFind(old));
data->index = q_func()->index(old.row(), old.column() + count, parent);
@ -890,18 +869,17 @@ void QAbstractItemModelPrivate::columnsInserted(const QModelIndex &parent,
} else {
qWarning() << "QAbstractItemModel::endInsertColumns: Invalid index (" << old.row() << ',' << old.column() + count << ") in model" << q_func();
}
}
}
}
void QAbstractItemModelPrivate::columnsAboutToBeRemoved(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved;
QVector<QPersistentModelIndexData *> persistent_invalidated;
QList<QPersistentModelIndexData *> persistent_moved;
QList<QPersistentModelIndexData *> persistent_invalidated;
// find the persistent indexes that are affected by the change, either by being in the removed subtree
// or by being on the same level and to the right of the removed columns
for (auto it = persistent.indexes.constBegin(); it != persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(persistent.indexes)) {
bool level_changed = false;
QModelIndex current = data->index;
while (current.isValid()) {
@ -926,11 +904,9 @@ void QAbstractItemModelPrivate::columnsAboutToBeRemoved(const QModelIndex &paren
void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
int first, int last)
{
QVector<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_moved.constBegin();
it != persistent_moved.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_moved = persistent.moved.pop();
const int count = (last - first) + 1; // it is important to only use the delta, because the change could be nested
for (auto *data : persistent_moved) {
QModelIndex old = data->index;
persistent.indexes.erase(persistent.indexes.constFind(old));
data->index = q_func()->index(old.row(), old.column() - count, parent);
@ -940,10 +916,8 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent,
qWarning() << "QAbstractItemModel::endRemoveColumns: Invalid index (" << old.row() << ',' << old.column() - count << ") in model" << q_func();
}
}
QVector<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
for (QVector<QPersistentModelIndexData *>::const_iterator it = persistent_invalidated.constBegin();
it != persistent_invalidated.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
const QList<QPersistentModelIndexData *> persistent_invalidated = persistent.invalidated.pop();
for (auto *data : persistent_invalidated) {
auto index = persistent.indexes.constFind(data->index);
if (index != persistent.indexes.constEnd())
persistent.indexes.erase(index);
@ -1565,7 +1539,7 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
\fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>())
\fn void QAbstractItemModel::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles = QList<int>())
This signal is emitted whenever the data in an existing item changes.
@ -2555,9 +2529,8 @@ bool QAbstractItemModel::setHeaderData(int section, Qt::Orientation orientation,
*/
void QAbstractItemModel::encodeData(const QModelIndexList &indexes, QDataStream &stream) const
{
QModelIndexList::ConstIterator it = indexes.begin();
for (; it != indexes.end(); ++it)
stream << (*it).row() << (*it).column() << itemData(*it);
for (const auto &index : indexes)
stream << index.row() << index.column() << itemData(index);
}
/*!
@ -2570,8 +2543,8 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare
int left = INT_MAX;
int bottom = 0;
int right = 0;
QVector<int> rows, columns;
QVector<QMap<int, QVariant> > data;
QList<int> rows, columns;
QList<QMap<int, QVariant>> data;
while (!stream.atEnd()) {
int r, c;
@ -2592,7 +2565,7 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare
int dragColumnCount = right - left + 1;
// Compute the number of continuous rows upon insertion and modify the rows to match
QVector<int> rowsToInsert(bottom + 1);
QList<int> rowsToInsert(bottom + 1);
for (int i = 0; i < rows.count(); ++i)
rowsToInsert[rows.at(i)] = 1;
for (int i = 0; i < rowsToInsert.count(); ++i) {
@ -2617,7 +2590,7 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare
row = qMax(0, row);
column = qMax(0, column);
QVector<QPersistentModelIndex> newIndexes(data.size());
QList<QPersistentModelIndex> newIndexes(data.size());
// set the data in the table
for (int j = 0; j < data.size(); ++j) {
int relativeRow = rows.at(j) - top;
@ -3258,7 +3231,7 @@ void QAbstractItemModel::changePersistentIndexList(const QModelIndexList &from,
Q_D(QAbstractItemModel);
if (d->persistent.indexes.isEmpty())
return;
QVector<QPersistentModelIndexData *> toBeReinserted;
QList<QPersistentModelIndexData *> toBeReinserted;
toBeReinserted.reserve(to.count());
for (int i = 0; i < from.count(); ++i) {
if (from.at(i) == to.at(i))
@ -3273,11 +3246,8 @@ void QAbstractItemModel::changePersistentIndexList(const QModelIndexList &from,
}
}
for (QVector<QPersistentModelIndexData *>::const_iterator it = toBeReinserted.constBegin();
it != toBeReinserted.constEnd() ; ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(toBeReinserted))
d->persistent.insertMultiAtEnd(data->index, data);
}
}
/*!
@ -3290,10 +3260,8 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const
Q_D(const QAbstractItemModel);
QModelIndexList result;
result.reserve(d->persistent.indexes.count());
for (auto it = d->persistent.indexes.constBegin(); it != d->persistent.indexes.constEnd(); ++it) {
QPersistentModelIndexData *data = *it;
for (auto *data : qAsConst(d->persistent.indexes))
result.append(data->index);
}
return result;
}
@ -3768,8 +3736,8 @@ bool QAbstractTableModel::dropMimeData(const QMimeData *data, Qt::DropAction act
if (parent.isValid() && row == -1 && column == -1) {
int top = INT_MAX;
int left = INT_MAX;
QVector<int> rows, columns;
QVector<QMap<int, QVariant> > data;
QList<int> rows, columns;
QList<QMap<int, QVariant>> data;
while (!stream.atEnd()) {
int r, c;
@ -3819,8 +3787,8 @@ bool QAbstractListModel::dropMimeData(const QMimeData *data, Qt::DropAction acti
if (parent.isValid() && row == -1 && column == -1) {
int top = INT_MAX;
int left = INT_MAX;
QVector<int> rows, columns;
QVector<QMap<int, QVariant> > data;
QList<int> rows, columns;
QList<QMap<int, QVariant>> data;
while (!stream.atEnd()) {
int r, c;

View File

@ -69,7 +69,7 @@ public:
void _q_slotColumnsInserted(const QModelIndex &parent, int, int);
void _q_slotColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
void _q_slotColumnsRemoved(const QModelIndex &parent, int, int);
void _q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QVector<int> &roles);
void _q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QList<int> &roles);
void _q_slotSourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);
void _q_slotSourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);
void _q_slotModelAboutToBeReset();
@ -80,7 +80,7 @@ public:
bool mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent,
int *sourceRow, int *sourceColumn, QModelIndex *sourceParent, QAbstractItemModel **sourceModel) const;
QVector<QAbstractItemModel *> m_models;
QList<QAbstractItemModel *> m_models;
int m_rowCount; // have to maintain it here since we can't compute during model destruction
int m_columnCount;
@ -88,8 +88,8 @@ public:
int m_newColumnCount;
// for layoutAboutToBeChanged/layoutChanged
QVector<QPersistentModelIndex> layoutChangePersistentIndexes;
QVector<QModelIndex> layoutChangeProxyIndexes;
QList<QPersistentModelIndex> layoutChangePersistentIndexes;
QList<QModelIndex> layoutChangeProxyIndexes;
};
QConcatenateTablesProxyModelPrivate::QConcatenateTablesProxyModelPrivate()
@ -470,7 +470,7 @@ void QConcatenateTablesProxyModel::addSourceModel(QAbstractItemModel *sourceMode
Q_D(QConcatenateTablesProxyModel);
Q_ASSERT(sourceModel);
Q_ASSERT(!d->m_models.contains(sourceModel));
connect(sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), this, SLOT(_q_slotDataChanged(QModelIndex,QModelIndex,QVector<int>)));
connect(sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QList<int>)), this, SLOT(_q_slotDataChanged(QModelIndex,QModelIndex,QList<int>)));
connect(sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(_q_slotRowsInserted(QModelIndex,int,int)));
connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(_q_slotRowsRemoved(QModelIndex,int,int)));
connect(sourceModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(_q_slotRowsAboutToBeInserted(QModelIndex,int,int)));
@ -617,7 +617,7 @@ void QConcatenateTablesProxyModelPrivate::_q_slotColumnsRemoved(const QModelInde
}
}
void QConcatenateTablesProxyModelPrivate::_q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QVector<int> &roles)
void QConcatenateTablesProxyModelPrivate::_q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QList<int> &roles)
{
Q_Q(QConcatenateTablesProxyModel);
Q_ASSERT(from.isValid());

View File

@ -69,7 +69,7 @@ class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate
void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);
void _q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
void _q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles);
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last);
void _q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);
@ -390,8 +390,8 @@ void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
this, SLOT(_q_sourceModelAboutToBeReset()));
disconnect(sourceModel(), SIGNAL(modelReset()),
this, SLOT(_q_sourceModelReset()));
disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QList<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QList<int>)));
disconnect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
disconnect(sourceModel(), SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
@ -431,8 +431,8 @@ void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
SLOT(_q_sourceModelAboutToBeReset()));
connect(sourceModel(), SIGNAL(modelReset()),
SLOT(_q_sourceModelReset()));
connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex,QList<int>)),
SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QList<int>)));
connect(sourceModel(), SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
connect(sourceModel(), SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
@ -499,7 +499,7 @@ void QIdentityProxyModelPrivate::_q_sourceColumnsRemoved(const QModelIndex &pare
q->endRemoveColumns();
}
void QIdentityProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
void QIdentityProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles)
{
Q_ASSERT(topLeft.isValid() ? topLeft.model() == model : true);
Q_ASSERT(bottomRight.isValid() ? bottomRight.model() == model : true);

View File

@ -306,7 +306,7 @@ bool QItemSelectionRange::operator<(const QItemSelectionRange &other) const
*/
static void rowLengthsFromRange(const QItemSelectionRange &range, QVector<QPair<QPersistentModelIndex, uint> > &result)
static void rowLengthsFromRange(const QItemSelectionRange &range, QList<QPair<QPersistentModelIndex, uint>> &result)
{
if (range.isValid() && range.model()) {
const QModelIndex topLeft = range.topLeft();
@ -495,9 +495,9 @@ QModelIndexList QItemSelection::indexes() const
return qSelectionIndexes<QModelIndexList>(*this);
}
static QVector<QPair<QPersistentModelIndex, uint> > qSelectionPersistentRowLengths(const QItemSelection &sel)
static QList<QPair<QPersistentModelIndex, uint>> qSelectionPersistentRowLengths(const QItemSelection &sel)
{
QVector<QPair<QPersistentModelIndex, uint> > result;
QList<QPair<QPersistentModelIndex, uint>> result;
for (const QItemSelectionRange &range : sel)
rowLengthsFromRange(range, result);
return result;
@ -902,14 +902,14 @@ void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged(const QList<QPersiste
savedPersistentRowLengths = qSelectionPersistentRowLengths(ranges);
savedPersistentCurrentRowLengths = qSelectionPersistentRowLengths(currentSelection);
} else {
savedPersistentIndexes = qSelectionIndexes<QVector<QPersistentModelIndex>>(ranges);
savedPersistentCurrentIndexes = qSelectionIndexes<QVector<QPersistentModelIndex>>(currentSelection);
savedPersistentIndexes = qSelectionIndexes<QList<QPersistentModelIndex>>(ranges);
savedPersistentCurrentIndexes = qSelectionIndexes<QList<QPersistentModelIndex>>(currentSelection);
}
}
/*!
\internal
*/
static QItemSelection mergeRowLengths(const QVector<QPair<QPersistentModelIndex, uint> > &rowLengths)
static QItemSelection mergeRowLengths(const QList<QPair<QPersistentModelIndex, uint>> &rowLengths)
{
if (rowLengths.isEmpty())
return QItemSelection();
@ -949,7 +949,7 @@ static QItemSelection mergeRowLengths(const QVector<QPair<QPersistentModelIndex,
Merges \a indexes into an item selection made up of ranges.
Assumes that the indexes are sorted.
*/
static QItemSelection mergeIndexes(const QVector<QPersistentModelIndex> &indexes)
static QItemSelection mergeIndexes(const QList<QPersistentModelIndex> &indexes)
{
QItemSelection colSpans;
// merge columns

View File

@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
typedef QVector<QPair<QModelIndex, QPersistentModelIndex> > QModelIndexPairList;
typedef QList<QPair<QModelIndex, QPersistentModelIndex>> QModelIndexPairList;
struct QSortFilterProxyModelDataChanged
{
@ -62,7 +62,7 @@ struct QSortFilterProxyModelDataChanged
QModelIndex bottomRight;
};
static inline QSet<int> qVectorToSet(const QVector<int> &vector)
static inline QSet<int> qListToSet(const QList<int> &vector)
{
return {vector.begin(), vector.end()};
}
@ -154,11 +154,11 @@ public:
};
struct Mapping {
QVector<int> source_rows;
QVector<int> source_columns;
QVector<int> proxy_rows;
QVector<int> proxy_columns;
QVector<QModelIndex> mapped_children;
QList<int> source_rows;
QList<int> source_columns;
QList<int> proxy_rows;
QList<int> proxy_columns;
QList<QModelIndex> mapped_children;
QModelIndex source_parent;
};
@ -215,7 +215,7 @@ public:
void _q_sourceDataChanged(const QModelIndex &source_top_left,
const QModelIndex &source_bottom_right,
const QVector<int> &roles);
const QList<int> &roles);
void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end);
void _q_sourceAboutToBeReset();
@ -258,27 +258,27 @@ public:
void sort();
bool update_source_sort_column();
int find_source_sort_column() const;
void sort_source_rows(QVector<int> &source_rows,
void sort_source_rows(QList<int> &source_rows,
const QModelIndex &source_parent) const;
QVector<QPair<int, QVector<int > > > proxy_intervals_for_source_items_to_add(
const QVector<int> &proxy_to_source, const QVector<int> &source_items,
QList<QPair<int, QList<int>>> proxy_intervals_for_source_items_to_add(
const QList<int> &proxy_to_source, const QList<int> &source_items,
const QModelIndex &source_parent, Qt::Orientation orient) const;
QVector<QPair<int, int > > proxy_intervals_for_source_items(
const QVector<int> &source_to_proxy, const QVector<int> &source_items) const;
QList<QPair<int, int>> proxy_intervals_for_source_items(
const QList<int> &source_to_proxy, const QList<int> &source_items) const;
void insert_source_items(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
const QVector<int> &source_items, const QModelIndex &source_parent,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QList<int> &source_items, const QModelIndex &source_parent,
Qt::Orientation orient, bool emit_signal = true);
void remove_source_items(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
const QVector<int> &source_items, const QModelIndex &source_parent,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QList<int> &source_items, const QModelIndex &source_parent,
Qt::Orientation orient, bool emit_signal = true);
void remove_proxy_interval(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
int proxy_start, int proxy_end, const QModelIndex &proxy_parent,
Qt::Orientation orient, bool emit_signal = true);
static inline void build_source_to_proxy_mapping(
const QVector<int> &proxy_to_source, QVector<int> &source_to_proxy, int start = 0);
const QList<int> &proxy_to_source, QList<int> &source_to_proxy, int start = 0);
void source_items_inserted(const QModelIndex &source_parent,
int start, int end, Qt::Orientation orient);
void source_items_about_to_be_removed(const QModelIndex &source_parent,
@ -286,7 +286,7 @@ public:
void source_items_removed(const QModelIndex &source_parent,
int start, int end, Qt::Orientation orient);
void proxy_item_range(
const QVector<int> &source_to_proxy, const QVector<int> &source_items,
const QList<int> &source_to_proxy, const QList<int> &source_items,
int &proxy_low, int &proxy_high) const;
QModelIndexPairList store_persistent_indexes() const;
@ -295,7 +295,7 @@ public:
void filter_about_to_be_changed(const QModelIndex &source_parent = QModelIndex());
void filter_changed(Direction dir, const QModelIndex &source_parent = QModelIndex());
QSet<int> handle_filter_changed(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QModelIndex &source_parent, Qt::Orientation orient);
void updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping,
@ -303,7 +303,7 @@ public:
void _q_sourceModelDestroyed() override;
bool needsReorder(const QVector<int> &source_rows, const QModelIndex &source_parent) const;
bool needsReorder(const QList<int> &source_rows, const QModelIndex &source_parent) const;
bool filterAcceptsRowInternal(int source_row, const QModelIndex &source_parent) const;
bool recursiveChildAcceptsRow(int source_row, const QModelIndex &source_parent) const;
@ -582,7 +582,7 @@ int QSortFilterProxyModelPrivate::find_source_sort_column() const
Sorts the given \a source_rows according to current sort column and order.
*/
void QSortFilterProxyModelPrivate::sort_source_rows(
QVector<int> &source_rows, const QModelIndex &source_parent) const
QList<int> &source_rows, const QModelIndex &source_parent) const
{
Q_Q(const QSortFilterProxyModel);
if (source_sort_column >= 0) {
@ -609,10 +609,10 @@ void QSortFilterProxyModelPrivate::sort_source_rows(
The result is a vector of pairs, where each pair represents a
(start, end) tuple, sorted in ascending order.
*/
QVector<QPair<int, int > > QSortFilterProxyModelPrivate::proxy_intervals_for_source_items(
const QVector<int> &source_to_proxy, const QVector<int> &source_items) const
QList<QPair<int, int>> QSortFilterProxyModelPrivate::proxy_intervals_for_source_items(
const QList<int> &source_to_proxy, const QList<int> &source_items) const
{
QVector<QPair<int, int> > proxy_intervals;
QList<QPair<int, int>> proxy_intervals;
if (source_items.isEmpty())
return proxy_intervals;
@ -657,8 +657,8 @@ QVector<QPair<int, int > > QSortFilterProxyModelPrivate::proxy_intervals_for_sou
rows/columnsRemoved(start, end) signals will be generated.
*/
void QSortFilterProxyModelPrivate::remove_source_items(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
const QVector<int> &source_items, const QModelIndex &source_parent,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QList<int> &source_items, const QModelIndex &source_parent,
Qt::Orientation orient, bool emit_signal)
{
Q_Q(QSortFilterProxyModel);
@ -687,7 +687,7 @@ void QSortFilterProxyModelPrivate::remove_source_items(
(inclusive) from this proxy model.
*/
void QSortFilterProxyModelPrivate::remove_proxy_interval(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source, int proxy_start, int proxy_end,
QList<int> &source_to_proxy, QList<int> &proxy_to_source, int proxy_start, int proxy_end,
const QModelIndex &proxy_parent, Qt::Orientation orient, bool emit_signal)
{
Q_Q(QSortFilterProxyModel);
@ -725,19 +725,19 @@ void QSortFilterProxyModelPrivate::remove_proxy_interval(
items), where items is a vector containing the (sorted) source items that
should be inserted at that proxy model location.
*/
QVector<QPair<int, QVector<int > > > QSortFilterProxyModelPrivate::proxy_intervals_for_source_items_to_add(
const QVector<int> &proxy_to_source, const QVector<int> &source_items,
QList<QPair<int, QList<int>>> QSortFilterProxyModelPrivate::proxy_intervals_for_source_items_to_add(
const QList<int> &proxy_to_source, const QList<int> &source_items,
const QModelIndex &source_parent, Qt::Orientation orient) const
{
Q_Q(const QSortFilterProxyModel);
QVector<QPair<int, QVector<int> > > proxy_intervals;
QList<QPair<int, QList<int>>> proxy_intervals;
if (source_items.isEmpty())
return proxy_intervals;
int proxy_low = 0;
int proxy_item = 0;
int source_items_index = 0;
QVector<int> source_items_in_interval;
QList<int> source_items_in_interval;
bool compare = (orient == Qt::Vertical && source_sort_column >= 0 && dynamic_sortfilter);
while (source_items_index < source_items.size()) {
source_items_in_interval.clear();
@ -786,7 +786,7 @@ QVector<QPair<int, QVector<int > > > QSortFilterProxyModelPrivate::proxy_interva
}
// Add interval to result
proxy_intervals.append(QPair<int, QVector<int> >(proxy_item, source_items_in_interval));
proxy_intervals.append(QPair<int, QList<int>>(proxy_item, source_items_in_interval));
}
return proxy_intervals;
}
@ -800,8 +800,8 @@ QVector<QPair<int, QVector<int > > > QSortFilterProxyModelPrivate::proxy_interva
that the proper rows/columnsInserted(start, end) signals will be generated.
*/
void QSortFilterProxyModelPrivate::insert_source_items(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
const QVector<int> &source_items, const QModelIndex &source_parent,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QList<int> &source_items, const QModelIndex &source_parent,
Qt::Orientation orient, bool emit_signal)
{
Q_Q(QSortFilterProxyModel);
@ -814,9 +814,9 @@ void QSortFilterProxyModelPrivate::insert_source_items(
const auto end = proxy_intervals.rend();
for (auto it = proxy_intervals.rbegin(); it != end; ++it) {
const QPair<int, QVector<int> > &interval = *it;
const QPair<int, QList<int>> &interval = *it;
const int proxy_start = interval.first;
const QVector<int> &source_items = interval.second;
const QList<int> &source_items = interval.second;
const int proxy_end = proxy_start + source_items.size() - 1;
if (emit_signal) {
@ -877,8 +877,8 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
}
Mapping *m = it.value();
QVector<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QVector<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
QList<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QList<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
int delta_item_count = end - start + 1;
int old_item_count = source_to_proxy.size();
@ -905,7 +905,7 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
}
// Figure out which items to add to mapping based on filter
QVector<int> source_items;
QList<int> source_items;
for (int i = start; i <= end; ++i) {
if ((orient == Qt::Vertical)
? filterAcceptsRowInternal(i, source_parent)
@ -919,8 +919,8 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
// If it was new rows make sure to create mappings for columns so that a
// valid mapping can be retrieved later and vice-versa.
QVector<int> &orthogonal_proxy_to_source = (orient == Qt::Horizontal) ? m->source_rows : m->source_columns;
QVector<int> &orthogonal_source_to_proxy = (orient == Qt::Horizontal) ? m->proxy_rows : m->proxy_columns;
QList<int> &orthogonal_proxy_to_source = (orient == Qt::Horizontal) ? m->source_rows : m->source_columns;
QList<int> &orthogonal_source_to_proxy = (orient == Qt::Horizontal) ? m->proxy_rows : m->proxy_columns;
if (orthogonal_source_to_proxy.isEmpty()) {
const int ortho_end = (orient == Qt::Horizontal) ? model->rowCount(source_parent) : model->columnCount(source_parent);
@ -965,11 +965,11 @@ void QSortFilterProxyModelPrivate::source_items_about_to_be_removed(
}
Mapping *m = it.value();
QVector<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QVector<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
QList<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QList<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
// figure out which items to remove
QVector<int> source_items_to_remove;
QList<int> source_items_to_remove;
int proxy_count = proxy_to_source.size();
for (int proxy_item = 0; proxy_item < proxy_count; ++proxy_item) {
int source_item = proxy_to_source.at(proxy_item);
@ -998,8 +998,8 @@ void QSortFilterProxyModelPrivate::source_items_removed(
}
Mapping *m = it.value();
QVector<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QVector<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
QList<int> &source_to_proxy = (orient == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QList<int> &proxy_to_source = (orient == Qt::Vertical) ? m->source_rows : m->source_columns;
if (end >= source_to_proxy.size())
end = source_to_proxy.size() - 1;
@ -1042,8 +1042,8 @@ void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &sour
Qt::Orientation orient, int start, int end, int delta_item_count, bool remove)
{
// see if any mapped children should be (re)moved
QVector<QPair<QModelIndex, Mapping*> > moved_source_index_mappings;
QVector<QModelIndex>::iterator it2 = parent_mapping->mapped_children.begin();
QList<QPair<QModelIndex, Mapping *>> moved_source_index_mappings;
auto it2 = parent_mapping->mapped_children.begin();
for ( ; it2 != parent_mapping->mapped_children.end();) {
const QModelIndex source_child_index = *it2;
const int pos = (orient == Qt::Vertical)
@ -1081,10 +1081,9 @@ void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &sour
}
// reinsert moved, mapped indexes
QVector<QPair<QModelIndex, Mapping*> >::iterator it = moved_source_index_mappings.begin();
for (; it != moved_source_index_mappings.end(); ++it) {
it->second->source_parent = it->first;
source_index_mapping.insert(it->first, it->second);
for (auto &pair : qAsConst(moved_source_index_mappings)) {
pair.second->source_parent = pair.first;
source_index_mapping.insert(pair.first, pair.second);
}
}
@ -1092,7 +1091,7 @@ void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &sour
\internal
*/
void QSortFilterProxyModelPrivate::proxy_item_range(
const QVector<int> &source_to_proxy, const QVector<int> &source_items,
const QList<int> &source_to_proxy, const QList<int> &source_items,
int &proxy_low, int &proxy_high) const
{
proxy_low = INT_MAX;
@ -1111,7 +1110,7 @@ void QSortFilterProxyModelPrivate::proxy_item_range(
\internal
*/
void QSortFilterProxyModelPrivate::build_source_to_proxy_mapping(
const QVector<int> &proxy_to_source, QVector<int> &source_to_proxy, int start)
const QList<int> &proxy_to_source, QList<int> &source_to_proxy, int start)
{
if (start == 0)
source_to_proxy.fill(-1);
@ -1197,8 +1196,8 @@ void QSortFilterProxyModelPrivate::filter_changed(Direction dir, const QModelInd
// the iterator it2.
// The m->mapped_children vector can be appended to with indexes which are no longer filtered
// out (in create_mapping) when this function recurses for child indexes.
const QVector<QModelIndex> mappedChildren = m->mapped_children;
QVector<int> indexesToRemove;
const QList<QModelIndex> mappedChildren = m->mapped_children;
QList<int> indexesToRemove;
for (int i = 0; i < mappedChildren.size(); ++i) {
const QModelIndex &source_child_index = mappedChildren.at(i);
if (rows_removed.contains(source_child_index.row()) || columns_removed.contains(source_child_index.column())) {
@ -1208,8 +1207,8 @@ void QSortFilterProxyModelPrivate::filter_changed(Direction dir, const QModelInd
filter_changed(dir, source_child_index);
}
}
QVector<int>::const_iterator removeIt = indexesToRemove.constEnd();
const QVector<int>::const_iterator removeBegin = indexesToRemove.constBegin();
QList<int>::const_iterator removeIt = indexesToRemove.constEnd();
const QList<int>::const_iterator removeBegin = indexesToRemove.constBegin();
// We can't just remove these items from mappedChildren while iterating above and then
// do something like m->mapped_children = mappedChildren, because mapped_children might
@ -1227,12 +1226,12 @@ void QSortFilterProxyModelPrivate::filter_changed(Direction dir, const QModelInd
returns the removed items indexes
*/
QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,
QList<int> &source_to_proxy, QList<int> &proxy_to_source,
const QModelIndex &source_parent, Qt::Orientation orient)
{
Q_Q(QSortFilterProxyModel);
// Figure out which mapped items to remove
QVector<int> source_items_remove;
QList<int> source_items_remove;
for (int i = 0; i < proxy_to_source.count(); ++i) {
const int source_item = proxy_to_source.at(i);
if ((orient == Qt::Vertical)
@ -1243,7 +1242,7 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
}
}
// Figure out which non-mapped items to insert
QVector<int> source_items_insert;
QList<int> source_items_insert;
int source_count = source_to_proxy.size();
for (int source_item = 0; source_item < source_count; ++source_item) {
if (source_to_proxy.at(source_item) == -1) {
@ -1264,10 +1263,10 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
insert_source_items(source_to_proxy, proxy_to_source,
source_items_insert, source_parent, orient);
}
return qVectorToSet(source_items_remove);
return qListToSet(source_items_remove);
}
bool QSortFilterProxyModelPrivate::needsReorder(const QVector<int> &source_rows, const QModelIndex &source_parent) const
bool QSortFilterProxyModelPrivate::needsReorder(const QList<int> &source_rows, const QModelIndex &source_parent) const
{
Q_Q(const QSortFilterProxyModel);
Q_ASSERT(source_sort_column != -1);
@ -1296,7 +1295,7 @@ bool QSortFilterProxyModelPrivate::needsReorder(const QVector<int> &source_rows,
void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &source_top_left,
const QModelIndex &source_bottom_right,
const QVector<int> &roles)
const QList<int> &roles)
{
Q_Q(QSortFilterProxyModel);
if (!source_top_left.isValid() || !source_bottom_right.isValid())
@ -1328,10 +1327,10 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
Mapping *m = it.value();
// Figure out how the source changes affect us
QVector<int> source_rows_remove;
QVector<int> source_rows_insert;
QVector<int> source_rows_change;
QVector<int> source_rows_resort;
QList<int> source_rows_remove;
QList<int> source_rows_insert;
QList<int> source_rows_change;
QList<int> source_rows_resort;
int end = qMin(source_bottom_right.row(), m->proxy_rows.count() - 1);
for (int source_row = source_top_left.row(); source_row <= end; ++source_row) {
if (dynamic_sortfilter) {
@ -1361,8 +1360,8 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
if (!source_rows_remove.isEmpty()) {
remove_source_items(m->proxy_rows, m->source_rows,
source_rows_remove, source_parent, Qt::Vertical);
QSet<int> source_rows_remove_set = qVectorToSet(source_rows_remove);
QVector<QModelIndex>::iterator childIt = m->mapped_children.end();
QSet<int> source_rows_remove_set = qListToSet(source_rows_remove);
QList<QModelIndex>::iterator childIt = m->mapped_children.end();
while (childIt != m->mapped_children.begin()) {
--childIt;
const QModelIndex source_child_index = *childIt;
@ -1433,14 +1432,14 @@ void QSortFilterProxyModelPrivate::_q_sourceHeaderDataChanged(Qt::Orientation or
Q_Q(QSortFilterProxyModel);
Mapping *m = create_mapping(QModelIndex()).value();
const QVector<int> &source_to_proxy = (orientation == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
const QList<int> &source_to_proxy = (orientation == Qt::Vertical) ? m->proxy_rows : m->proxy_columns;
QVector<int> proxy_positions;
QList<int> proxy_positions;
proxy_positions.reserve(end - start + 1);
{
Q_ASSERT(source_to_proxy.size() > end);
QVector<int>::const_iterator it = source_to_proxy.constBegin() + start;
const QVector<int>::const_iterator endIt = source_to_proxy.constBegin() + end + 1;
QList<int>::const_iterator it = source_to_proxy.constBegin() + start;
const QList<int>::const_iterator endIt = source_to_proxy.constBegin() + end + 1;
for ( ; it != endIt; ++it) {
if (*it != -1)
proxy_positions.push_back(*it);
@ -1594,7 +1593,7 @@ void QSortFilterProxyModelPrivate::_q_sourceRowsInserted(
return;
// last_top_source should now become visible
_q_sourceDataChanged(last_top_source, last_top_source, QVector<int>());
_q_sourceDataChanged(last_top_source, last_top_source, QList<int>());
}
}
@ -1630,7 +1629,7 @@ void QSortFilterProxyModelPrivate::_q_sourceRowsRemoved(
}
if (to_hide.isValid())
_q_sourceDataChanged(to_hide, to_hide, QVector<int>());
_q_sourceDataChanged(to_hide, to_hide, QList<int>());
}
}
@ -1934,8 +1933,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
beginResetModel();
disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QList<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QList<int>)));
disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
@ -1991,8 +1990,8 @@ void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)
QAbstractProxyModel::setSourceModel(sourceModel);
connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)));
connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QList<int>)),
this, SLOT(_q_sourceDataChanged(QModelIndex,QModelIndex,QList<int>)));
connect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(_q_sourceHeaderDataChanged(Qt::Orientation,int,int)));
@ -2311,7 +2310,7 @@ bool QSortFilterProxyModel::removeRows(int row, int count, const QModelIndex &pa
}
// remove corresponding source intervals
// ### if this proves to be slow, we can switch to single-row removal
QVector<int> rows;
QList<int> rows;
rows.reserve(count);
for (int i = row; i < row + count; ++i)
rows.append(m->source_rows.at(i));
@ -2351,7 +2350,7 @@ bool QSortFilterProxyModel::removeColumns(int column, int count, const QModelInd
return d->model->removeColumns(source_column, count, source_parent);
}
// remove corresponding source intervals
QVector<int> columns;
QList<int> columns;
columns.reserve(count);
for (int i = column; i < column + count; ++i)
columns.append(m->source_columns.at(i));

View File

@ -43,7 +43,7 @@
#include "qstringlistmodel.h"
#include <QtCore/qvector.h>
#include <QtCore/qlist.h>
#include <algorithm>
@ -344,7 +344,7 @@ void QStringListModel::sort(int, Qt::SortOrder order)
{
emit layoutAboutToBeChanged(QList<QPersistentModelIndex>(), VerticalSortHint);
QVector<QPair<QString, int> > list;
QList<QPair<QString, int>> list;
const int lstCount = lst.count();
list.reserve(lstCount);
for (int i = 0; i < lstCount; ++i)
@ -356,7 +356,7 @@ void QStringListModel::sort(int, Qt::SortOrder order)
std::sort(list.begin(), list.end(), decendingLessThan);
lst.clear();
QVector<int> forwarding(lstCount);
QList<int> forwarding(lstCount);
for (int i = 0; i < lstCount; ++i) {
lst.append(list.at(i).first);
forwarding[list.at(i).second] = i;

View File

@ -39,7 +39,7 @@
#include "qtransposeproxymodel.h"
#include <private/qtransposeproxymodel_p.h>
#include <QtCore/qvector.h>
#include <QtCore/qlist.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qsize.h>
@ -111,7 +111,8 @@ void QTransposeProxyModelPrivate::onLayoutAboutToBeChanged(const QList<QPersiste
emit q->layoutAboutToBeChanged(proxyParents, proxyHint);
}
void QTransposeProxyModelPrivate::onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles)
void QTransposeProxyModelPrivate::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
const QList<int> &roles)
{
Q_Q(QTransposeProxyModel);
emit q->dataChanged(q->mapFromSource(topLeft), q->mapFromSource(bottomRight), roles);
@ -205,7 +206,7 @@ void QTransposeProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)
QAbstractProxyModel::setSourceModel(newSourceModel);
if (d->model) {
using namespace std::placeholders;
d->sourceConnections = QVector<QMetaObject::Connection>{
d->sourceConnections = QList<QMetaObject::Connection>{
connect(d->model, &QAbstractItemModel::modelAboutToBeReset, this, &QTransposeProxyModel::beginResetModel),
connect(d->model, &QAbstractItemModel::modelReset, this, &QTransposeProxyModel::endResetModel),
connect(d->model, &QAbstractItemModel::dataChanged, this, std::bind(&QTransposeProxyModelPrivate::onDataChanged, d, _1, _2, _3)),

View File

@ -41,7 +41,6 @@
#include "qcoreapplication.h"
#include "qcoreapplication_p.h"
#include "qstringlist.h"
#include "qvector.h"
#include "qfileinfo.h"
#include "qcorecmdlineargs_p.h"
#ifndef QT_NO_QOBJECT

View File

@ -43,7 +43,6 @@
#include "qlist.h"
#include "qsemaphore.h"
#include "qsharedpointer.h"
#include "qvector.h"
#include "qthread.h"
#include "qcoreapplication.h"
#include <QtCore/qrunnable.h>
@ -119,7 +118,7 @@ static void runPendingCppRunnables(JNIEnv */*env*/, jobject /*obj*/)
namespace {
struct GenericMotionEventListeners {
QMutex mutex;
QVector<QtAndroidPrivate::GenericMotionEventListener *> listeners;
QList<QtAndroidPrivate::GenericMotionEventListener *> listeners;
};
enum {
@ -168,7 +167,7 @@ static jboolean dispatchGenericMotionEvent(JNIEnv *, jclass, jobject event)
namespace {
struct KeyEventListeners {
QMutex mutex;
QVector<QtAndroidPrivate::KeyEventListener *> listeners;
QList<QtAndroidPrivate::KeyEventListener *> listeners;
};
}
Q_GLOBAL_STATIC(KeyEventListeners, g_keyEventListeners)

View File

@ -196,7 +196,7 @@ public:
bool isFlag;
bool isScoped;
QList<QByteArray> keys;
QVector<int> values;
QList<int> values;
};
Q_DECLARE_TYPEINFO(QMetaEnumBuilderPrivate, Q_MOVABLE_TYPE);

View File

@ -45,7 +45,7 @@
#include "qreadwritelock.h"
#include "qstring.h"
#include "qstringlist.h"
#include "qvector.h"
#include "qlist.h"
#include "qlocale.h"
#if QT_CONFIG(easingcurve)
#include "qeasingcurve.h"
@ -103,7 +103,7 @@ struct DefinedTypesFilter {
struct QMetaTypeCustomRegistry
{
QReadWriteLock lock;
QVector<QtPrivate::QMetaTypeInterface *> registry;
QList<QtPrivate::QMetaTypeInterface *> registry;
QHash<QByteArray, QtPrivate::QMetaTypeInterface *> aliases;
#ifndef QT_NO_DATASTREAM
struct DataStreamOps
@ -237,7 +237,7 @@ Q_GLOBAL_STATIC(QMetaTypeCustomRegistry, customTypeRegistry)
\list
\li Pointers to classes derived from QObject
\li QList<T>, QVector<T>, QQueue<T>, QStack<T> or QSet<T>
\li QList<T>, QQueue<T>, QStack<T> or QSet<T>
where T is a registered meta type
\li QHash<T1, T2>, QMap<T1, T2> or QPair<T1, T2> where T1 and T2 are
registered meta types

View File

@ -404,7 +404,7 @@ QObject *QFactoryLoader::instance(int index) const
lock.unlock();
#endif
QVector<QStaticPlugin> staticPlugins = QPluginLoader::staticPlugins();
QList<QStaticPlugin> staticPlugins = QPluginLoader::staticPlugins();
for (int i = 0; i < staticPlugins.count(); ++i) {
const QJsonObject object = staticPlugins.at(i).metaData();
if (object.value(QLatin1String("IID")) != QLatin1String(d->iid.constData(), d->iid.size()))

View File

@ -56,7 +56,7 @@
#include <errno.h>
#endif // NO_ERROR_H
#include <qdebug.h>
#include <qvector.h>
#include <qlist.h>
#include <qdir.h>
#include <qendian.h>
#include <qjsondocument.h>

View File

@ -427,7 +427,7 @@ QLibrary::LoadHints QPluginLoader::loadHints() const
#endif // QT_CONFIG(library)
typedef QVector<QStaticPlugin> StaticPluginList;
typedef QList<QStaticPlugin> StaticPluginList;
Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)
/*!
@ -467,12 +467,12 @@ QObjectList QPluginLoader::staticInstances()
meta data information.
\sa staticInstances()
*/
QVector<QStaticPlugin> QPluginLoader::staticPlugins()
QList<QStaticPlugin> QPluginLoader::staticPlugins()
{
StaticPluginList *plugins = staticPluginList();
if (plugins)
return *plugins;
return QVector<QStaticPlugin>();
return QList<QStaticPlugin>();
}
/*!

View File

@ -66,7 +66,7 @@ using namespace QtCbor;
from those two, though there may be loss of information in some
conversions.
\sa QCborValue, QCborMap, QJsonArray, QList, QVector
\sa QCborValue, QCborMap, QJsonArray, QList
*/
/*!

View File

@ -298,9 +298,9 @@ void QCborMap::clear()
\sa QMap::keys(), QHash::keys()
*/
QVector<QCborValue> QCborMap::keys() const
QList<QCborValue> QCborMap::keys() const
{
QVector<QCborValue> result;
QList<QCborValue> result;
if (d) {
result.reserve(size());
for (qsizetype i = 0; i < d->elements.size(); i += 2)

View File

@ -1494,7 +1494,7 @@ static inline QCborContainerPrivate *createContainerFromCbor(QCborStreamReader &
// Clamp allocation to 1M elements (avoids crashing due to corrupt
// stream or loss of precision when converting from quint64 to
// QVector::size_type).
// QList::size_type).
len = qMin(len, quint64(1024 * 1024 - 1));
if (len) {
d = new QCborContainerPrivate;

View File

@ -163,7 +163,7 @@ QT_BEGIN_NAMESPACE
\section1 Reading and Writing Qt Collection Classes
The Qt container classes can also be serialized to a QDataStream.
These include QList, QVector, QSet, QHash, and QMap.
These include QList, QSet, QHash, and QMap.
The stream operators are declared as non-members of the classes.
\target Serializing Qt Classes

View File

@ -1935,7 +1935,7 @@ QStringRef QXmlStreamReader::text() const
/*! If the tokenType() is \l DTD, this function returns the DTD's
notation declarations. Otherwise an empty vector is returned.
The QXmlStreamNotationDeclarations class is defined to be a QVector
The QXmlStreamNotationDeclarations class is defined to be a QList
of QXmlStreamNotationDeclaration.
*/
QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const
@ -1950,7 +1950,7 @@ QXmlStreamNotationDeclarations QXmlStreamReader::notationDeclarations() const
/*! If the tokenType() is \l DTD, this function returns the DTD's
unparsed (external) entity declarations. Otherwise an empty vector is returned.
The QXmlStreamEntityDeclarations class is defined to be a QVector
The QXmlStreamEntityDeclarations class is defined to be a QList
of QXmlStreamEntityDeclaration.
*/
QXmlStreamEntityDeclarations QXmlStreamReader::entityDeclarations() const
@ -2046,7 +2046,7 @@ void QXmlStreamReader::setEntityExpansionLimit(int limit)
element's namespace declarations. Otherwise an empty vector is
returned.
The QXmlStreamNamespaceDeclarations class is defined to be a QVector
The QXmlStreamNamespaceDeclarations class is defined to be a QList
of QXmlStreamNamespaceDeclaration.
\sa addExtraNamespaceDeclaration(), addExtraNamespaceDeclarations()
@ -2428,7 +2428,7 @@ QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &o
\typedef QXmlStreamNotationDeclarations
\relates QXmlStreamNotationDeclaration
Synonym for QVector<QXmlStreamNotationDeclaration>.
Synonym for QList<QXmlStreamNotationDeclaration>.
*/
@ -2507,7 +2507,7 @@ Returns the public identifier.
\typedef QXmlStreamNamespaceDeclarations
\relates QXmlStreamNamespaceDeclaration
Synonym for QVector<QXmlStreamNamespaceDeclaration>.
Synonym for QList<QXmlStreamNamespaceDeclaration>.
*/
/*!
@ -2592,7 +2592,7 @@ Returns the namespaceUri.
\typedef QXmlStreamEntityDeclarations
\relates QXmlStreamEntityDeclaration
Synonym for QVector<QXmlStreamEntityDeclaration>.
Synonym for QList<QXmlStreamEntityDeclaration>.
*/
/*!

View File

@ -127,7 +127,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
}
//Documentation recommends having it 5 times as big as the input
QVector<UCCollationValue> ret(string.size() * 5);
QList<UCCollationValue> ret(string.size() * 5);
ItemCount actualSize;
int status = UCGetCollationKey(d->collator,
reinterpret_cast<const UniChar *>(string.constData()),

View File

@ -98,7 +98,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
QVarLengthArray<wchar_t> original;
stringToWCharArray(original, string);
QVector<wchar_t> result(original.size());
QList<wchar_t> result(original.size());
if (d->isC()) {
std::copy(original.cbegin(), original.cend(), result.begin());
} else {

View File

@ -4261,7 +4261,7 @@ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats
QStringList QLocale::uiLanguages() const
{
QStringList uiLanguages;
QVector<QLocale> locales;
QList<QLocale> locales;
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::UILanguages, QVariant());

View File

@ -51,7 +51,6 @@
#include "qstring.h"
#include "qstringlist.h"
#include "qstringmatcher.h"
#include "qvector.h"
#include "private/qlocking_p.h"
#include <limits.h>
@ -849,7 +848,7 @@ static bool isWord(QChar ch)
Merges two vectors of ints and puts the result into the first
one.
*/
static void mergeInto(QVector<int> *a, const QVector<int> &b)
static void mergeInto(QList<int> *a, const QList<int> &b)
{
int asize = a->size();
int bsize = b.size();
@ -862,7 +861,7 @@ static void mergeInto(QVector<int> *a, const QVector<int> &b)
#endif
} else if (bsize >= 1) {
int csize = asize + bsize;
QVector<int> c(csize);
QList<int> c(csize);
int i = 0, j = 0, k = 0;
while (i < asize) {
if (j < bsize) {
@ -1035,8 +1034,6 @@ static size_t qHash(const QRegExpEngineKey &key, size_t seed = 0) noexcept
class QRegExpEngine;
//Q_DECLARE_TYPEINFO(QVector<int>, Q_MOVABLE_TYPE);
/*
This is the engine state during matching.
*/
@ -1064,7 +1061,7 @@ struct QRegExpMatchState
int slideTabSize; // size of slide table
int capturedSize;
#ifndef QT_NO_REGEXP_BACKREF
QList<QVector<int> > sleeping; // list of back-reference sleepers
QList<QList<int>> sleeping; // list of back-reference sleepers
#endif
int matchLen; // length of match
int oneTestMatchedLen; // length of partial match
@ -1094,7 +1091,7 @@ struct QRegExpAutomatonState
int atom; // which atom does this state belong to?
#endif
int match; // what does it match? (see CharClassBit and BackRefBit)
QVector<int> outs; // out-transitions
QList<int> outs; // out-transitions
QMap<int, int> reenter; // atoms reentered when transiting out
QMap<int, int> anchors; // anchors met when transiting out
@ -1176,7 +1173,7 @@ public:
bool in(QChar ch) const;
#ifndef QT_NO_REGEXP_OPTIM
const QVector<int> &firstOccurrence() const { return occ1; }
const QList<int> &firstOccurrence() const { return occ1; }
#endif
#if defined(QT_DEBUG)
@ -1184,9 +1181,9 @@ public:
#endif
private:
QVector<QRegExpCharClassRange> r; // character ranges
QList<QRegExpCharClassRange> r; // character ranges
#ifndef QT_NO_REGEXP_OPTIM
QVector<int> occ1; // first-occurrence array
QList<int> occ1; // first-occurrence array
#endif
uint c; // character classes
bool n; // negative?
@ -1199,8 +1196,8 @@ struct QRegExpCharClass
#ifndef QT_NO_REGEXP_OPTIM
QRegExpCharClass() { occ1.fill(0, NumBadChars); }
const QVector<int> &firstOccurrence() const { return occ1; }
QVector<int> occ1;
const QList<int> &firstOccurrence() const { return occ1; }
QList<int> occ1;
#endif
};
#endif
@ -1230,9 +1227,9 @@ public:
int createState(int bref);
#endif
void addCatTransitions(const QVector<int> &from, const QVector<int> &to);
void addCatTransitions(const QList<int> &from, const QList<int> &to);
#ifndef QT_NO_REGEXP_CAPTURE
void addPlusTransitions(const QVector<int> &from, const QVector<int> &to, int atom);
void addPlusTransitions(const QList<int> &from, const QList<int> &to, int atom);
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
@ -1290,23 +1287,23 @@ private:
bool bruteMatch(QRegExpMatchState &matchState) const;
#endif
QVector<QRegExpAutomatonState> s; // array of states
QList<QRegExpAutomatonState> s; // array of states
#ifndef QT_NO_REGEXP_CAPTURE
QVector<QRegExpAtom> f; // atom hierarchy
QList<QRegExpAtom> f; // atom hierarchy
int nf; // number of atoms
int cf; // current atom
QVector<int> captureForOfficialCapture;
QList<int> captureForOfficialCapture;
#endif
int officialncap; // number of captures, seen from the outside
int ncap; // number of captures, seen from the inside
#ifndef QT_NO_REGEXP_CCLASS
QVector<QRegExpCharClass> cl; // array of character classes
QList<QRegExpCharClass> cl; // array of character classes
#endif
#ifndef QT_NO_REGEXP_LOOKAHEAD
QVector<QRegExpLookahead *> ahead; // array of lookaheads
QList<QRegExpLookahead *> ahead; // array of lookaheads
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
QVector<QRegExpAnchorAlternation> aa; // array of (a, b) pairs of anchors
QList<QRegExpAnchorAlternation> aa; // array of (a, b) pairs of anchors
#endif
#ifndef QT_NO_REGEXP_OPTIM
bool caretAnchored; // does the regexp start with ^?
@ -1328,7 +1325,7 @@ private:
QString goodStr; // the string that any match has to contain
int minl; // the minimum length of a match
QVector<int> occ1; // first-occurrence array
QList<int> occ1; // first-occurrence array
#endif
/*
@ -1370,8 +1367,8 @@ private:
void addAnchorsToEngine(const Box &to) const;
QRegExpEngine *eng; // the automaton under construction
QVector<int> ls; // the left states (firstpos)
QVector<int> rs; // the right states (lastpos)
QList<int> ls; // the left states (firstpos)
QList<int> rs; // the right states (lastpos)
QMap<int, int> lanchors; // the left anchors
QMap<int, int> ranchors; // the right anchors
int skipanchors; // the anchors to match if the box is skipped
@ -1387,7 +1384,7 @@ private:
int minl; // the minimum length of this box
#ifndef QT_NO_REGEXP_OPTIM
QVector<int> occ1; // first-occurrence array
QList<int> occ1; // first-occurrence array
#endif
};
@ -1502,7 +1499,7 @@ QRegExpEngine::~QRegExpEngine()
void QRegExpMatchState::prepareForMatch(QRegExpEngine *eng)
{
/*
We use one QVector<int> for all the big data used a lot in
We use one QList<int> for all the big data used a lot in
matchHere() and friends.
*/
int ns = eng->s.size(); // number of states
@ -1661,18 +1658,18 @@ int QRegExpEngine::createState(int bref)
capturing.
*/
void QRegExpEngine::addCatTransitions(const QVector<int> &from, const QVector<int> &to)
void QRegExpEngine::addCatTransitions(const QList<int> &from, const QList<int> &to)
{
for (int i = 0; i < from.size(); i++)
mergeInto(&s[from.at(i)].outs, to);
}
#ifndef QT_NO_REGEXP_CAPTURE
void QRegExpEngine::addPlusTransitions(const QVector<int> &from, const QVector<int> &to, int atom)
void QRegExpEngine::addPlusTransitions(const QList<int> &from, const QList<int> &to, int atom)
{
for (int i = 0; i < from.size(); i++) {
QRegExpAutomatonState &st = s[from.at(i)];
const QVector<int> oldOuts = st.outs;
const QList<int> oldOuts = st.outs;
mergeInto(&st.outs, to);
if (f.at(atom).capture != QRegExpAtom::NoCapture) {
for (int j = 0; j < to.size(); j++) {
@ -1971,7 +1968,7 @@ bool QRegExpMatchState::testAnchor(int i, int a, const int *capBegin)
#endif
#ifndef QT_NO_REGEXP_LOOKAHEAD
if ((a & QRegExpEngine::Anchor_LookaheadMask) != 0) {
const QVector<QRegExpLookahead *> &ahead = eng->ahead;
const QList<QRegExpLookahead *> &ahead = eng->ahead;
for (j = 0; j < ahead.size(); j++) {
if ((a & (QRegExpEngine::Anchor_FirstLookahead << j)) != 0) {
QRegExpMatchState matchState;
@ -2134,7 +2131,7 @@ bool QRegExpMatchState::matchHere()
for (j = 0; j < ncur; j++) {
int cur = curStack[j];
const QRegExpAutomatonState &scur = eng->s.at(cur);
const QVector<int> &outs = scur.outs;
const QList<int> &outs = scur.outs;
for (k = 0; k < outs.size(); k++) {
int next = outs.at(k);
const QRegExpAutomatonState &snext = eng->s.at(next);
@ -2363,7 +2360,7 @@ bool QRegExpMatchState::matchHere()
nextStack.
*/
if (needSomeSleep > 0) {
QVector<int> zzZ(2 + 2 * ncap);
QList<int> zzZ(2 + 2 * ncap);
zzZ[0] = i + needSomeSleep;
zzZ[1] = next;
if (ncap > 0) {
@ -2394,7 +2391,7 @@ bool QRegExpMatchState::matchHere()
j = 0;
while (j < sleeping.count()) {
if (sleeping.at(j)[0] == i) {
const QVector<int> &zzZ = sleeping.at(j);
const QList<int> &zzZ = sleeping.at(j);
int next = zzZ[1];
const int *capBegin = zzZ.data() + 2;
const int *capEnd = zzZ.data() + 2 + ncap;

View File

@ -43,8 +43,8 @@
#include <QtCore/qcoreapplication.h>
#include <QtCore/qhashfunctions.h>
#include <QtCore/qlist.h>
#include <QtCore/qmutex.h>
#include <QtCore/qvector.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qdebug.h>
#include <QtCore/qthreadstorage.h>
@ -787,7 +787,7 @@ struct QRegularExpressionMatchPrivate : QSharedData
// the capturedOffsets vector contains pairs of (start, end) positions
// for each captured substring
QVector<int> capturedOffsets;
QList<int> capturedOffsets;
int capturedCount = 0;

View File

@ -3906,9 +3906,9 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
int numCaptures = re.captureCount();
// 1. build the backreferences vector, holding where the backreferences
// 1. build the backreferences list, holding where the backreferences
// are in the replacement string
QVector<QStringCapture> backReferences;
QList<QStringCapture> backReferences;
const int al = after.length();
const QChar *ac = after.unicode();
@ -3940,7 +3940,7 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
int newLength = 0; // length of the new string, with all the replacements
int lastEnd = 0;
QVector<QStringRef> chunks;
QList<QStringRef> chunks;
while (iterator.hasNext()) {
QRegularExpressionMatch match = iterator.next();
int len;
@ -4317,8 +4317,8 @@ int QString::count(const QRegularExpression &re) const
QString QString::section(const QString &sep, int start, int end, SectionFlags flags) const
{
const QVector<QStringRef> sections = splitRef(sep, Qt::KeepEmptyParts,
(flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
const QList<QStringRef> sections = splitRef(
sep, Qt::KeepEmptyParts, (flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
const int sectionsSize = sections.size();
if (!(flags & SectionSkipEmpty)) {
if (start < 0)
@ -4373,10 +4373,7 @@ public:
};
Q_DECLARE_TYPEINFO(qt_section_chunk, Q_MOVABLE_TYPE);
static QString extractSections(const QVector<qt_section_chunk> &sections,
int start,
int end,
QString::SectionFlags flags)
static QString extractSections(const QList<qt_section_chunk> &sections, int start, int end, QString::SectionFlags flags)
{
const int sectionsSize = sections.size();
@ -4465,7 +4462,7 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti
if (flags & SectionCaseInsensitiveSeps)
sep.setPatternOptions(sep.patternOptions() | QRegularExpression::CaseInsensitiveOption);
QVector<qt_section_chunk> sections;
QList<qt_section_chunk> sections;
int n = length(), m = 0, last_m = 0, last_len = 0;
QRegularExpressionMatchIterator iterator = sep.globalMatch(*this);
while (iterator.hasNext()) {
@ -4951,30 +4948,30 @@ QByteArray QtPrivate::convertToUtf8(QStringView string)
return qt_convert_to_utf8(string);
}
static QVector<uint> qt_convert_to_ucs4(QStringView string);
static QList<uint> qt_convert_to_ucs4(QStringView string);
/*!
\since 4.2
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
The returned vector is not \\0'-terminated.
The returned list is not \\0'-terminated.
\sa fromUtf8(), toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder, fromUcs4(), toWCharArray()
*/
QVector<uint> QString::toUcs4() const
QList<uint> QString::toUcs4() const
{
return qt_convert_to_ucs4(*this);
}
static QVector<uint> qt_convert_to_ucs4(QStringView string)
static QList<uint> qt_convert_to_ucs4(QStringView string)
{
QVector<uint> v(string.length());
QList<uint> v(string.length());
uint *a = const_cast<uint*>(v.constData());
QStringIterator it(string);
while (it.hasNext())
@ -4988,19 +4985,19 @@ static QVector<uint> qt_convert_to_ucs4(QStringView string)
\internal
\relates QStringView
Returns a UCS-4/UTF-32 representation of \a string as a QVector<uint>.
Returns a UCS-4/UTF-32 representation of \a string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
The returned vector is not \\0'-terminated.
The returned list is not \\0'-terminated.
\sa QString::toUcs4(), QStringView::toUcs4(), QtPrivate::convertToLatin1(),
QtPrivate::convertToLocal8Bit(), QtPrivate::convertToUtf8()
*/
QVector<uint> QtPrivate::convertToUcs4(QStringView string)
QList<uint> QtPrivate::convertToUcs4(QStringView string)
{
return qt_convert_to_ucs4(string);
}
@ -7242,10 +7239,9 @@ QStringList QString::split(const QString &sep, Qt::SplitBehavior behavior, Qt::C
\since 5.14
\sa QStringRef split()
*/
QVector<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior,
Qt::CaseSensitivity cs) const
QList<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
return splitString<QVector<QStringRef>>(QStringRef(this), sep, behavior, cs);
return splitString<QList<QStringRef>>(QStringRef(this), sep, behavior, cs);
}
/*!
@ -7261,10 +7257,9 @@ QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensit
\overload
\since 5.14
*/
QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior,
Qt::CaseSensitivity cs) const
QList<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
return splitString<QVector<QStringRef> >(QStringRef(this), QStringView(&sep, 1), behavior, cs);
return splitString<QList<QStringRef>>(QStringRef(this), QStringView(&sep, 1), behavior, cs);
}
/*!
@ -7279,18 +7274,18 @@ QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior,
\since 5.14
*/
QVector<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
QList<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
return splitString<QVector<QStringRef> >(*this, sep, behavior, cs);
return splitString<QList<QStringRef>>(*this, sep, behavior, cs);
}
/*!
\overload
\since 5.14
*/
QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
QList<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
return splitString<QVector<QStringRef> >(*this, QStringView(&sep, 1), behavior, cs);
return splitString<QList<QStringRef>>(*this, QStringView(&sep, 1), behavior, cs);
}
/*!
@ -7311,7 +7306,7 @@ QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt:
*/
QList<QStringView> QStringView::split(QStringView sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
{
return splitString<QVector<QStringView>>(QStringView(*this), sep, behavior, cs);
return splitString<QList<QStringView>>(QStringView(*this), sep, behavior, cs);
}
QList<QStringView> QStringView::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
@ -7388,16 +7383,16 @@ QStringList QString::split(const QRegularExpression &re, Qt::SplitBehavior behav
Splits the string into substring references wherever the regular expression
\a re matches, and returns the list of those strings. If \a re
does not match anywhere in the string, splitRef() returns a
single-element vector containing this string reference.
single-element list containing this string reference.
\note All references are valid as long this string is alive. Destroying this
string will cause all references to be dangling pointers.
\sa split() QStringRef
*/
QVector<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBehavior behavior) const
QList<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBehavior behavior) const
{
return splitString<QVector<QStringRef> >(QStringRef(this), re, behavior);
return splitString<QList<QStringRef>>(QStringRef(this), re, behavior);
}
/*!
@ -7406,7 +7401,7 @@ QVector<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBeh
Splits the string into substring views wherever the regular expression
\a re matches, and returns the list of those strings. If \a re
does not match anywhere in the string, splitRef() returns a
single-element vector containing this string reference.
single-element list containing this string reference.
\note All references are valid as long this string is alive. Destroying this
string will cause all references to be dangling pointers.
@ -11638,18 +11633,18 @@ QByteArray QStringRef::toUtf8() const
/*!
\since 4.8
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode's replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
The returned vector is not \\0'-terminated.
The returned list is not \\0'-terminated.
\sa toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder
*/
QVector<uint> QStringRef::toUcs4() const
QList<uint> QStringRef::toUcs4() const
{
return qt_convert_to_ucs4(*this);
}

View File

@ -296,7 +296,7 @@ QT_BEGIN_NAMESPACE
\code
// assuming tok's value_type is QStringView, then...
auto tok = QStringTokenizer{~~~};
// ... rac1 is a QVector:
// ... rac1 is a QList:
auto rac1 = tok.toContainer();
// ... rac2 is std::pmr::vector<QStringView>:
auto rac2 = tok.toContainer<std::pmr::vector<QStringView>>();

View File

@ -107,7 +107,7 @@ QT_BEGIN_NAMESPACE
\note We strongly discourage the use of QList<QStringView>,
because QList is a very inefficient container for QStringViews (it would heap-allocate
every element). Use QVector (or std::vector) to hold QStringViews instead.
every element). Use QList (or std::vector) to hold QStringViews instead.
\sa QString, QStringRef
*/
@ -898,16 +898,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn QVector<uint> QStringView::toUcs4() const
\fn QList<uint> QStringView::toUcs4() const
Returns a UCS-4/UTF-32 representation of the string as a QVector<uint>.
Returns a UCS-4/UTF-32 representation of the string as a QList<uint>.
UCS-4 is a Unicode codec and therefore it is lossless. All characters from
this string will be encoded in UCS-4. Any invalid sequence of code units in
this string is replaced by the Unicode replacement character
(QChar::ReplacementCharacter, which corresponds to \c{U+FFFD}).
The returned vector is not 0-terminated.
The returned list is not 0-terminated.
\sa toUtf8(), toLatin1(), toLocal8Bit(), QStringEncoder
*/

View File

@ -135,8 +135,8 @@ void QAdoptedThread::init()
d_func()->id = GetCurrentThreadId();
}
static QVector<HANDLE> qt_adopted_thread_handles;
static QVector<QThread *> qt_adopted_qthreads;
static QList<HANDLE> qt_adopted_thread_handles;
static QList<QThread *> qt_adopted_qthreads;
static QBasicMutex qt_adopted_thread_watcher_mutex;
static DWORD qt_adopted_thread_watcher_id = 0;
static HANDLE qt_adopted_thread_wakeup = 0;
@ -188,7 +188,7 @@ DWORD WINAPI qt_adopted_thread_watcher_function(LPVOID)
break;
}
QVector<HANDLE> handlesCopy = qt_adopted_thread_handles;
QList<HANDLE> handlesCopy = qt_adopted_thread_handles;
qt_adopted_thread_watcher_mutex.unlock();
DWORD ret = WAIT_TIMEOUT;

View File

@ -69,7 +69,7 @@ void qtsDebug(const char *fmt, ...)
#endif
static QBasicMutex destructorsMutex;
typedef QVector<void (*)(void *)> DestructorMap;
typedef QList<void (*)(void *)> DestructorMap;
Q_GLOBAL_STATIC(DestructorMap, destructors)
QThreadStorageData::QThreadStorageData(void (*func)(void *))
@ -118,7 +118,7 @@ void **QThreadStorageData::get() const
qWarning("QThreadStorage::get: QThreadStorage can only be used with threads started with QThread");
return nullptr;
}
QVector<void *> &tls = data->tls;
QList<void *> &tls = data->tls;
if (tls.size() <= id)
tls.resize(id + 1);
void **v = &tls[id];
@ -138,7 +138,7 @@ void **QThreadStorageData::set(void *p)
qWarning("QThreadStorage::set: QThreadStorage can only be used with threads started with QThread");
return nullptr;
}
QVector<void *> &tls = data->tls;
QList<void *> &tls = data->tls;
if (tls.size() <= id)
tls.resize(id + 1);
@ -170,7 +170,7 @@ void **QThreadStorageData::set(void *p)
void QThreadStorageData::finish(void **p)
{
QVector<void *> *tls = reinterpret_cast<QVector<void *> *>(p);
QList<void *> *tls = reinterpret_cast<QList<void *> *>(p);
if (!tls || tls->isEmpty() || !destructors())
return; // nothing to do

View File

@ -4748,7 +4748,7 @@ QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
return QDateTime(date, time, spec, offset);
}
case Qt::TextDate: {
QVector<QStringView > parts = QStringView{string}.split(QLatin1Char(' '), Qt::SkipEmptyParts);
QList<QStringView> parts = QStringView { string }.split(QLatin1Char(' '), Qt::SkipEmptyParts);
if ((parts.count() < 5) || (parts.count() > 6))
return QDateTime();
@ -4800,7 +4800,7 @@ QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
return QDateTime();
// ### fixme, use QStringView::tokenize() when available
QVector<QStringView > timeParts = parts.at(timePart).split(QLatin1Char(':'));
QList<QStringView> timeParts = parts.at(timePart).split(QLatin1Char(':'));
if (timeParts.count() < 2 || timeParts.count() > 3)
return QDateTime();
@ -4816,7 +4816,7 @@ QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
int millisecond = 0;
if (timeParts.count() > 2) {
// ### fixme, use QStringView::tokenize() when available
const QVector<QStringView > secondParts = timeParts.at(2).split(QLatin1Char('.'));
const QList<QStringView> secondParts = timeParts.at(2).split(QLatin1Char('.'));
if (secondParts.size() > 2) {
return QDateTime();
}

View File

@ -414,7 +414,7 @@ bool QDateTimeParser::parseFormat(const QString &newFormat)
QDTPDEBUGN("parseFormat: %s", newFormat.toLatin1().constData());
QVector<SectionNode> newSectionNodes;
QList<SectionNode> newSectionNodes;
Sections newDisplay;
QStringList newSeparators;
int i, index = 0;

View File

@ -310,7 +310,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
/*!
\typedef QTimeZone::OffsetDataList
Synonym for QVector<OffsetData>.
Synonym for QList<OffsetData>.
*/
/*!

View File

@ -193,9 +193,9 @@ static QTzHeader parseTzHeader(QDataStream &ds, bool *ok)
return hdr;
}
static QVector<QTzTransition> parseTzTransitions(QDataStream &ds, int tzh_timecnt, bool longTran)
static QList<QTzTransition> parseTzTransitions(QDataStream &ds, int tzh_timecnt, bool longTran)
{
QVector<QTzTransition> transitions(tzh_timecnt);
QList<QTzTransition> transitions(tzh_timecnt);
if (longTran) {
// Parse tzh_timecnt x 8-byte transition times
@ -226,9 +226,9 @@ static QVector<QTzTransition> parseTzTransitions(QDataStream &ds, int tzh_timecn
return transitions;
}
static QVector<QTzType> parseTzTypes(QDataStream &ds, int tzh_typecnt)
static QList<QTzType> parseTzTypes(QDataStream &ds, int tzh_typecnt)
{
QVector<QTzType> types(tzh_typecnt);
QList<QTzType> types(tzh_typecnt);
// Parse tzh_typecnt x transition types
for (int i = 0; i < tzh_typecnt && ds.status() == QDataStream::Ok; ++i) {
@ -248,7 +248,7 @@ static QVector<QTzType> parseTzTypes(QDataStream &ds, int tzh_typecnt)
return types;
}
static QMap<int, QByteArray> parseTzAbbreviations(QDataStream &ds, int tzh_charcnt, const QVector<QTzType> &types)
static QMap<int, QByteArray> parseTzAbbreviations(QDataStream &ds, int tzh_charcnt, const QList<QTzType> &types)
{
// Parse the abbreviation list which is tzh_charcnt long with '\0' separated strings. The
// QTzType.tz_abbrind index points to the first char of the abbreviation in the array, not the
@ -304,9 +304,10 @@ static void parseTzLeapSeconds(QDataStream &ds, int tzh_leapcnt, bool longTran)
}
}
static QVector<QTzType> parseTzIndicators(QDataStream &ds, const QVector<QTzType> &types, int tzh_ttisstdcnt, int tzh_ttisgmtcnt)
static QList<QTzType> parseTzIndicators(QDataStream &ds, const QList<QTzType> &types, int tzh_ttisstdcnt,
int tzh_ttisgmtcnt)
{
QVector<QTzType> result = types;
QList<QTzType> result = types;
bool temp;
/*
Scan and discard indicators.
@ -531,11 +532,10 @@ PosixZone PosixZone::parse(const char *&pos, const char *end)
return {std::move(name), offset};
}
static QVector<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArray &posixRule,
int startYear, int endYear,
qint64 lastTranMSecs)
static QList<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArray &posixRule, int startYear, int endYear,
qint64 lastTranMSecs)
{
QVector<QTimeZonePrivate::Data> result;
QList<QTimeZonePrivate::Data> result;
// POSIX Format is like "TZ=CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00"
// i.e. "std offset dst [offset],start[/time],end[/time]"
@ -699,10 +699,10 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
QTzHeader hdr = parseTzHeader(ds, &ok);
if (!ok || ds.status() != QDataStream::Ok)
return ret;
QVector<QTzTransition> tranList = parseTzTransitions(ds, hdr.tzh_timecnt, false);
QList<QTzTransition> tranList = parseTzTransitions(ds, hdr.tzh_timecnt, false);
if (ds.status() != QDataStream::Ok)
return ret;
QVector<QTzType> typeList = parseTzTypes(ds, hdr.tzh_typecnt);
QList<QTzType> typeList = parseTzTypes(ds, hdr.tzh_typecnt);
if (ds.status() != QDataStream::Ok)
return ret;
QMap<int, QByteArray> abbrevMap = parseTzAbbreviations(ds, hdr.tzh_charcnt, typeList);
@ -747,7 +747,7 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
const int size = abbrevMap.size();
ret.m_abbreviations.clear();
ret.m_abbreviations.reserve(size);
QVector<int> abbrindList;
QList<int> abbrindList;
abbrindList.reserve(size);
for (auto it = abbrevMap.cbegin(), end = abbrevMap.cend(); it != end; ++it) {
ret.m_abbreviations.append(it.value());
@ -1008,7 +1008,7 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::dataForTzTransition(QTzTransitionTime
return data;
}
QVector<QTimeZonePrivate::Data> QTzTimeZonePrivate::getPosixTransitions(qint64 msNear) const
QList<QTimeZonePrivate::Data> QTzTimeZonePrivate::getPosixTransitions(qint64 msNear) const
{
const int year = QDateTime::fromMSecsSinceEpoch(msNear, Qt::UTC).date().year();
// The Data::atMSecsSinceEpoch of the single entry if zone is constant:
@ -1022,7 +1022,7 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
// and we have a POSIX rule, then use it:
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < forMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(forMSecsSinceEpoch);
QList<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(forMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[forMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch <= forMSecsSinceEpoch;
@ -1060,7 +1060,7 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::nextTransition(qint64 afterMSecsSince
// and we have a POSIX rule, then use it:
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < afterMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(afterMSecsSinceEpoch);
QList<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(afterMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[afterMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch <= afterMSecsSinceEpoch;
@ -1083,7 +1083,7 @@ QTimeZonePrivate::Data QTzTimeZonePrivate::previousTransition(qint64 beforeMSecs
// and we have a POSIX rule, then use it:
if (!cached_data.m_posixRule.isEmpty()
&& (tranCache().isEmpty() || tranCache().last().atMSecsSinceEpoch < beforeMSecsSinceEpoch)) {
QVector<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(beforeMSecsSinceEpoch);
QList<QTimeZonePrivate::Data> posixTrans = getPosixTransitions(beforeMSecsSinceEpoch);
auto it = std::partition_point(posixTrans.cbegin(), posixTrans.cend(),
[beforeMSecsSinceEpoch] (const QTimeZonePrivate::Data &at) {
return at.atMSecsSinceEpoch < beforeMSecsSinceEpoch;

View File

@ -39,7 +39,7 @@
on all items in a given container or in a given range.
You can use these algorithms with any \l {container
class} that provides STL-style iterators, including Qt's QList,
QVector, QMap, and QHash classes.
QMap, and QHash classes.
Most algorithms take \l {STL-style iterators} as parameters. The
algorithms are generic in the sense that they aren't bound to a
@ -143,7 +143,7 @@
\row \li \c{i < j} \li returns \c true if iterator \c j comes after iterator \c i
\endtable
QList and QVector's non-const iterator types are random access iterators.
QList's non-const iterator type is random access iterator.
\section1 Qt and the STL Algorithms

View File

@ -107,7 +107,7 @@ QT_BEGIN_NAMESPACE
QBitArray(0). We recommend that you always use isEmpty() and
avoid isNull().
\sa QByteArray, QVector
\sa QByteArray, QList
*/
/*!

View File

@ -43,7 +43,7 @@
#include <qcoreapplication.h>
#include <private/qcoreapplication_p.h>
#include <qhash.h>
#include <qvector.h>
#include <qlist.h>
#include <qdebug.h>
#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
# include <qt_windows.h>
@ -109,7 +109,7 @@ public:
QString description;
QString syntax;
};
QVector<PositionalArgumentDefinition> positionalArgumentDefinitions;
QList<PositionalArgumentDefinition> positionalArgumentDefinitions;
//! The parsing mode for "-abc"
QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode;

View File

@ -308,7 +308,7 @@
#endif
#include <QtCore/qpoint.h>
#include <QtCore/qvector.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@ -357,7 +357,7 @@ QDataStream &operator>>(QDataStream &stream, TCBPoint &point)
return stream;
}
typedef QVector<TCBPoint> TCBPoints;
typedef QList<TCBPoint> TCBPoints;
class QEasingCurveFunction
{
@ -375,7 +375,7 @@ public:
qreal _p;
qreal _a;
qreal _o;
QVector<QPointF> _bezierCurves;
QList<QPointF> _bezierCurves;
TCBPoints _tcbPoints;
};
@ -468,8 +468,8 @@ struct BezierEase : public QEasingCurveFunction
qreal p3x, p3y;
};
QVector<SingleCubicBezier> _curves;
QVector<qreal> _intervals;
QList<SingleCubicBezier> _curves;
QList<qreal> _intervals;
int _curveCount;
bool _init;
bool _valid;
@ -1307,10 +1307,10 @@ void QEasingCurve::addCubicBezierSegment(const QPointF & c1, const QPointF & c2,
d_ptr->config->_bezierCurves << c1 << c2 << endPoint;
}
QVector<QPointF> static inline tcbToBezier(const TCBPoints &tcbPoints)
QList<QPointF> static inline tcbToBezier(const TCBPoints &tcbPoints)
{
const int count = tcbPoints.count();
QVector<QPointF> bezierPoints;
QList<QPointF> bezierPoints;
bezierPoints.reserve(3 * (count - 1));
for (int i = 1; i < count; i++) {
@ -1388,9 +1388,9 @@ void QEasingCurve::addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qre
If the easing curve does not have a custom bezier easing curve the list
is empty.
*/
QVector<QPointF> QEasingCurve::toCubicSpline() const
QList<QPointF> QEasingCurve::toCubicSpline() const
{
return d_ptr->config ? d_ptr->config->_bezierCurves : QVector<QPointF>();
return d_ptr->config ? d_ptr->config->_bezierCurves : QList<QPointF>();
}
/*!
@ -1406,8 +1406,8 @@ void QEasingCurvePrivate::setType_helper(QEasingCurve::Type newType)
qreal amp = -1.0;
qreal period = -1.0;
qreal overshoot = -1.0;
QVector<QPointF> bezierCurves;
QVector<TCBPoint> tcbPoints;
QList<QPointF> bezierCurves;
QList<TCBPoint> tcbPoints;
if (config) {
amp = config->_a;

View File

@ -43,7 +43,7 @@
#ifdef QT_QMAP_DEBUG
# include <qstring.h>
# include <qvector.h>
# include <qlist.h>
#endif
QT_BEGIN_NAMESPACE

View File

@ -61,10 +61,10 @@
The example will output 3, 2, 1 in that order.
QStack inherits from QVector. All of QVector's functionality also
QStack inherits from QList. All of QList's functionality also
applies to QStack. For example, you can use isEmpty() to test
whether the stack is empty, and you can traverse a QStack using
QVector's iterator classes (for example, QVectorIterator). But in
QList's iterator classes (for example, QListIterator). But in
addition, QStack provides three convenience functions that make
it easy to implement LIFO semantics: push(), pop(), and top().
@ -73,7 +73,7 @@
won't let you, for example, store a QWidget as a value; instead,
store a QWidget *.
\sa QVector, QQueue
\sa QList, QQueue
*/
/*!
@ -89,7 +89,7 @@
Adds element \a t to the top of the stack.
This is the same as QVector::append().
This is the same as QList::append().
\sa pop(), top()
*/
@ -100,7 +100,7 @@
Returns a reference to the stack's top item. This function
assumes that the stack isn't empty.
This is the same as QVector::last().
This is the same as QList::last().
\sa pop(), push(), isEmpty()
*/

View File

@ -38,7 +38,7 @@
****************************************************************************/
// ### Qt6: verify if we can remove this, somehow.
// First, try to see if the extern template from qvector.h is necessary.
// First, try to see if the extern template from qlist.h is necessary.
// If it still is, check if removing the copy constructors in qarraydata.h
// make the calling convention of both sets of begin() and end() functions
// match, as it does for the IA-64 C++ ABI.
@ -47,5 +47,5 @@
# error "This file must be compiled with no precompiled headers"
#endif
// the Q_TEMPLATE_EXTERN at the bottom of qvector.h will do the trick
#include <QtCore/qvector.h>
// the Q_TEMPLATE_EXTERN at the bottom of qlist.h will do the trick
#include <QtCore/qlist.h>

View File

@ -96,13 +96,13 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn QVersionNumber::QVersionNumber(const QVector<int> &seg)
\fn QVersionNumber::QVersionNumber(const QList<int> &seg)
Constructs a version number from the list of numbers contained in \a seg.
*/
/*!
\fn QVersionNumber::QVersionNumber(QVector<int> &&seg)
\fn QVersionNumber::QVersionNumber(QList<int> &&seg)
Move-constructs a version number from the list of numbers contained in \a seg.
@ -168,18 +168,18 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn const QVector<int>& QVersionNumber::segments() const
\fn const QList<int>& QVersionNumber::segments() const
Returns all of the numerical segments.
\sa majorVersion(), minorVersion(), microVersion()
*/
QVector<int> QVersionNumber::segments() const
QList<int> QVersionNumber::segments() const
{
if (m_segments.isUsingPointer())
return *m_segments.pointer_segments;
QVector<int> result;
QList<int> result;
result.resize(segmentCount());
for (int i = 0; i < segmentCount(); ++i)
result[i] = segmentAt(i);
@ -462,7 +462,7 @@ QVersionNumber QVersionNumber::fromString(QStringView string, int *suffixIndex)
*/
QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex)
{
QVector<int> seg;
QList<int> seg;
const char *start = string.begin();
const char *end = start;
@ -487,7 +487,7 @@ QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex
void QVersionNumber::SegmentStorage::setVector(int len, int maj, int min, int mic)
{
pointer_segments = new QVector<int>;
pointer_segments = new QList<int>;
pointer_segments->resize(len);
pointer_segments->data()[0] = maj;
if (len > 1) {
@ -525,7 +525,7 @@ QDataStream& operator<<(QDataStream &out, const QVersionNumber &version)
QDataStream& operator>>(QDataStream &in, QVersionNumber &version)
{
if (!version.m_segments.isUsingPointer())
version.m_segments.pointer_segments = new QVector<int>;
version.m_segments.pointer_segments = new QList<int>;
in >> *version.m_segments.pointer_segments;
return in;
}