From 0475460102411979ab51c365cb2bec2c05b69cb4 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 Jun 2020 11:06:12 +0200 Subject: Use QList instead of QVector in corelib Applied to headers only. Source file to be changed separately. Omitted statemachine for now to avoid conflicts. Omitted qmetatype.h for now - to be handled later. Task-number: QTBUG-84469 Change-Id: I317376037a62467c313467d92955ad0b7473aa97 Reviewed-by: Sona Kurazyan --- .../animation/qsequentialanimationgroup_p.h | 2 +- src/corelib/animation/qvariantanimation.h | 8 ++-- src/corelib/animation/qvariantanimation_p.h | 1 - src/corelib/global/qt_pch.h | 1 - src/corelib/io/qdebug.h | 7 ++-- src/corelib/io/qfilesystemwatcher_fsevents_p.h | 5 +-- src/corelib/io/qfilesystemwatcher_kqueue_p.h | 3 +- src/corelib/io/qfilesystemwatcher_win_p.h | 6 +-- src/corelib/io/qiodevice_p.h | 8 ++-- src/corelib/io/qloggingregistry_p.h | 8 ++-- src/corelib/io/qsettings_p.h | 2 +- src/corelib/itemmodels/qabstractitemmodel.h | 9 +++-- src/corelib/itemmodels/qabstractitemmodel_p.h | 7 ++-- .../itemmodels/qconcatenatetablesproxymodel.h | 3 +- src/corelib/itemmodels/qidentityproxymodel.h | 2 +- src/corelib/itemmodels/qitemselectionmodel.h | 5 +-- src/corelib/itemmodels/qitemselectionmodel_p.h | 8 ++-- src/corelib/itemmodels/qsortfilterproxymodel.h | 4 +- src/corelib/itemmodels/qtransposeproxymodel_p.h | 6 +-- src/corelib/kernel/qcorecmdlineargs_p.h | 1 - src/corelib/kernel/qeventdispatcher_unix_p.h | 4 +- src/corelib/kernel/qobject_p.h | 11 +++--- src/corelib/mimetypes/qmimedatabase_p.h | 2 +- src/corelib/plugin/qpluginloader.h | 4 +- src/corelib/serialization/qcbormap.h | 2 +- src/corelib/serialization/qcborvalue.h | 1 - src/corelib/serialization/qcborvalue_p.h | 2 +- src/corelib/serialization/qdatastream.h | 4 +- src/corelib/serialization/qjson_p.h | 6 +-- src/corelib/serialization/qxmlstream.h | 15 ++++---- src/corelib/text/qcollator_p.h | 6 +-- src/corelib/text/qstring.h | 24 ++++++------ src/corelib/text/qstringalgorithms.h | 2 +- src/corelib/text/qstringtokenizer.h | 8 ++-- src/corelib/text/qstringview.h | 2 +- src/corelib/thread/qfutureinterface.h | 8 ++-- src/corelib/thread/qresultstore.h | 22 +++++------ src/corelib/thread/qthread_p.h | 12 +++--- src/corelib/thread/qthreadpool_p.h | 2 +- src/corelib/time/qdatetimeparser_p.h | 10 ++--- src/corelib/time/qtimezone.h | 2 +- src/corelib/time/qtimezoneprivate_p.h | 12 +++--- src/corelib/tools/qcache.h | 6 +-- src/corelib/tools/qeasingcurve.h | 4 +- src/corelib/tools/qflatmap_p.h | 10 ++--- src/corelib/tools/qhash.h | 44 ++++++++-------------- src/corelib/tools/qringbuffer_p.h | 4 +- src/corelib/tools/qstack.h | 9 ++--- src/corelib/tools/qversionnumber.h | 30 +++++++-------- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 2 +- 50 files changed, 167 insertions(+), 199 deletions(-) diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h index c082d6b524..b788771fe5 100644 --- a/src/corelib/animation/qsequentialanimationgroup_p.h +++ b/src/corelib/animation/qsequentialanimationgroup_p.h @@ -92,7 +92,7 @@ public: // this is the actual duration of uncontrolled animations // it helps seeking and even going forward - QVector actualDuration; + QList actualDuration; void restart(); int lastLoop; diff --git a/src/corelib/animation/qvariantanimation.h b/src/corelib/animation/qvariantanimation.h index e47fa14b1c..f1721b8a65 100644 --- a/src/corelib/animation/qvariantanimation.h +++ b/src/corelib/animation/qvariantanimation.h @@ -40,11 +40,11 @@ #ifndef QVARIANTANIMATION_H #define QVARIANTANIMATION_H -#include #include -#include -#include +#include +#include #include +#include QT_REQUIRE_CONFIG(animation); @@ -62,7 +62,7 @@ class Q_CORE_EXPORT QVariantAnimation : public QAbstractAnimation public: typedef QPair KeyValue; - typedef QVector KeyValues; + typedef QList KeyValues; QVariantAnimation(QObject *parent = nullptr); ~QVariantAnimation(); diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h index 57b59cf876..3425777ba5 100644 --- a/src/corelib/animation/qvariantanimation_p.h +++ b/src/corelib/animation/qvariantanimation_p.h @@ -54,7 +54,6 @@ #include "qvariantanimation.h" #include #include -#include #include "private/qabstractanimation_p.h" diff --git a/src/corelib/global/qt_pch.h b/src/corelib/global/qt_pch.h index 092fc7d40c..8e59ace85d 100644 --- a/src/corelib/global/qt_pch.h +++ b/src/corelib/global/qt_pch.h @@ -75,5 +75,4 @@ #include #include #include -#include #endif diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 9ee19f5fd4..46fd762874 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -262,10 +261,10 @@ inline QDebug printAssociativeContainer(QDebug debug, const char *which, const A } // namespace QtPrivate -template -inline QDebug operator<<(QDebug debug, const QVector &vec) +template +inline QDebug operator<<(QDebug debug, const QList &vec) { - return QtPrivate::printSequentialContainer(debug, "QVector", vec); + return QtPrivate::printSequentialContainer(debug, "QList", vec); } template diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h index 6e8e7d4567..ad23805afb 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h +++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h @@ -53,11 +53,10 @@ #include "qfilesystemwatcher_p.h" -#include #include -#include -#include +#include #include +#include #include #include diff --git a/src/corelib/io/qfilesystemwatcher_kqueue_p.h b/src/corelib/io/qfilesystemwatcher_kqueue_p.h index 8e11e4b7da..e0c7ff60f2 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue_p.h +++ b/src/corelib/io/qfilesystemwatcher_kqueue_p.h @@ -55,9 +55,8 @@ #include #include -#include -#include #include +#include QT_REQUIRE_CONFIG(filesystemwatcher); struct kevent; diff --git a/src/corelib/io/qfilesystemwatcher_win_p.h b/src/corelib/io/qfilesystemwatcher_win_p.h index 138b6badf2..7808aff2ac 100644 --- a/src/corelib/io/qfilesystemwatcher_win_p.h +++ b/src/corelib/io/qfilesystemwatcher_win_p.h @@ -54,12 +54,12 @@ #include "qfilesystemwatcher_p.h" #include -#include #include #include #include +#include #include -#include +#include QT_BEGIN_NAMESPACE @@ -157,7 +157,7 @@ public: void wakeup(); QMutex mutex; - QVector handles; + QList handles; int msg; HandleForDirHash handleForDir; diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h index 15a53a67dc..da46b983cd 100644 --- a/src/corelib/io/qiodevice_p.h +++ b/src/corelib/io/qiodevice_p.h @@ -51,12 +51,12 @@ // We mean it. // -#include "QtCore/qiodevice.h" #include "QtCore/qbytearray.h" +#include "QtCore/qiodevice.h" +#include "QtCore/qlist.h" #include "QtCore/qobjectdefs.h" #include "QtCore/qstring.h" #include "private/qringbuffer_p.h" -#include "QtCore/qvector.h" #ifndef QT_NO_QOBJECT #include "private/qobject_p.h" #endif @@ -83,8 +83,8 @@ public: QIODevice::OpenMode openMode; QString errorString; - QVector readBuffers; - QVector writeBuffers; + QList readBuffers; + QList writeBuffers; class QRingBufferRef { QRingBuffer *m_buf; diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h index 3ac429b147..1a924f07dc 100644 --- a/src/corelib/io/qloggingregistry_p.h +++ b/src/corelib/io/qloggingregistry_p.h @@ -53,11 +53,11 @@ #include #include +#include #include #include #include #include -#include class tst_QLoggingRegistry; @@ -98,14 +98,14 @@ public: void setContent(const QString &content); void setContent(QTextStream &stream); - QVector rules() const { return _rules; } + QList rules() const { return _rules; } private: void parseNextLine(QStringView line); private: bool m_inRulesSection = false; - QVector _rules; + QList _rules; }; class Q_AUTOTEST_EXPORT QLoggingRegistry @@ -143,7 +143,7 @@ private: QMutex registryMutex; // protected by mutex: - QVector ruleSets[NumRuleSets]; + QList ruleSets[NumRuleSets]; QHash categories; QLoggingCategory::CategoryFilter categoryFilter; diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index 548fcb591d..bd8a40a324 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -293,7 +293,7 @@ private: void ensureAllSectionsParsed(QConfFile *confFile) const; void ensureSectionParsed(QConfFile *confFile, const QSettingsKey &key) const; - QVector confFiles; + QList confFiles; QSettings::ReadFunc readFunc; QSettings::WriteFunc writeFunc; QString extension; diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h index ddebf835c8..d55e1f4b05 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.h +++ b/src/corelib/itemmodels/qabstractitemmodel.h @@ -40,10 +40,10 @@ #ifndef QABSTRACTITEMMODEL_H #define QABSTRACTITEMMODEL_H -#include -#include #include -#include +#include +#include +#include QT_REQUIRE_CONFIG(itemmodel); @@ -257,7 +257,8 @@ public: Q_REQUIRED_RESULT bool checkIndex(const QModelIndex &index, CheckIndexOptions options = CheckIndexOption::NoOption) const; Q_SIGNALS: - void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles = QVector()); + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, + const QList &roles = QList()); void headerDataChanged(Qt::Orientation orientation, int first, int last); void layoutChanged(const QList &parents = QList(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); void layoutAboutToBeChanged(const QList &parents = QList(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h index fca5f76200..6b2f69cf30 100644 --- a/src/corelib/itemmodels/qabstractitemmodel_p.h +++ b/src/corelib/itemmodels/qabstractitemmodel_p.h @@ -82,7 +82,8 @@ public: ~QAbstractItemModelPrivate(); void removePersistentIndexData(QPersistentModelIndexData *data); - void movePersistentIndexes(const QVector &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation); + void movePersistentIndexes(const QList &indexes, int change, const QModelIndex &parent, + Qt::Orientation orientation); void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last); void rowsInserted(const QModelIndex &parent, int first, int last); void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last); @@ -142,8 +143,8 @@ public: struct Persistent { Persistent() {} QMultiHash indexes; - QStack > moved; - QStack > invalidated; + QStack> moved; + QStack> invalidated; void insertMultiAtEnd(const QModelIndex& key, QPersistentModelIndexData *data); } persistent; diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h index 1fa84d5f51..a119bab098 100644 --- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h +++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h @@ -91,7 +91,8 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_slotColumnsInserted(const QModelIndex &parent, int, int)) Q_PRIVATE_SLOT(d_func(), void _q_slotColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end)) Q_PRIVATE_SLOT(d_func(), void _q_slotColumnsRemoved(const QModelIndex &parent, int, int)) - Q_PRIVATE_SLOT(d_func(), void _q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QVector &roles)) + Q_PRIVATE_SLOT(d_func(), + void _q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QList &roles)) Q_PRIVATE_SLOT(d_func(), void _q_slotSourceLayoutAboutToBeChanged(QList, QAbstractItemModel::LayoutChangeHint)) Q_PRIVATE_SLOT(d_func(), void _q_slotSourceLayoutChanged(const QList &, QAbstractItemModel::LayoutChangeHint)) Q_PRIVATE_SLOT(d_func(), void _q_slotModelAboutToBeReset()) diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h index 4c14e6176a..ce2ac68f89 100644 --- a/src/corelib/itemmodels/qidentityproxymodel.h +++ b/src/corelib/itemmodels/qidentityproxymodel.h @@ -101,7 +101,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)) Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)) - Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(QModelIndex,QModelIndex,QVector)) + Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(QModelIndex, QModelIndex, QList)) Q_PRIVATE_SLOT(d_func(), void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last)) Q_PRIVATE_SLOT(d_func(), void _q_sourceLayoutAboutToBeChanged(const QList &sourceParents, QAbstractItemModel::LayoutChangeHint hint)) diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index c1ce49521c..f735bf85a8 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -42,10 +42,9 @@ #include -#include -#include -#include #include +#include +#include QT_REQUIRE_CONFIG(itemmodel); diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h index ba85f22be3..c520e50517 100644 --- a/src/corelib/itemmodels/qitemselectionmodel_p.h +++ b/src/corelib/itemmodels/qitemselectionmodel_p.h @@ -97,10 +97,10 @@ public: QItemSelection currentSelection; QPersistentModelIndex currentIndex; QItemSelectionModel::SelectionFlags currentCommand; - QVector savedPersistentIndexes; - QVector savedPersistentCurrentIndexes; - QVector > savedPersistentRowLengths; - QVector > savedPersistentCurrentRowLengths; + QList savedPersistentIndexes; + QList savedPersistentCurrentIndexes; + QList> savedPersistentRowLengths; + QList> savedPersistentCurrentRowLengths; // optimization when all indexes are selected bool tableSelected; QPersistentModelIndex tableParent; diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 10853b2040..d2c5054351 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -194,7 +194,9 @@ private: Q_DECLARE_PRIVATE(QSortFilterProxyModel) Q_DISABLE_COPY(QSortFilterProxyModel) - Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right, const QVector &roles)) + Q_PRIVATE_SLOT(d_func(), + void _q_sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right, + const QList &roles)) Q_PRIVATE_SLOT(d_func(), void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end)) Q_PRIVATE_SLOT(d_func(), void _q_sourceAboutToBeReset()) Q_PRIVATE_SLOT(d_func(), void _q_sourceReset()) diff --git a/src/corelib/itemmodels/qtransposeproxymodel_p.h b/src/corelib/itemmodels/qtransposeproxymodel_p.h index fb5ce5c117..8cee3d2288 100644 --- a/src/corelib/itemmodels/qtransposeproxymodel_p.h +++ b/src/corelib/itemmodels/qtransposeproxymodel_p.h @@ -62,14 +62,14 @@ class QTransposeProxyModelPrivate : public QAbstractProxyModelPrivate Q_DISABLE_COPY(QTransposeProxyModelPrivate) private: QTransposeProxyModelPrivate() = default; - QVector sourceConnections; - QVector layoutChangePersistentIndexes; + QList sourceConnections; + QList layoutChangePersistentIndexes; QModelIndexList layoutChangeProxyIndexes; QModelIndex uncheckedMapToSource(const QModelIndex &proxyIndex) const; QModelIndex uncheckedMapFromSource(const QModelIndex &sourceIndex) const; void onLayoutChanged(const QList &parents, QAbstractItemModel::LayoutChangeHint hint); void onLayoutAboutToBeChanged(const QList &parents, QAbstractItemModel::LayoutChangeHint hint); - void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles); + void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList &roles); void onHeaderDataChanged(Qt::Orientation orientation, int first, int last); void onColumnsAboutToBeInserted(const QModelIndex &parent, int first, int last); void onColumnsAboutToBeRemoved(const QModelIndex &parent, int first, int last); diff --git a/src/corelib/kernel/qcorecmdlineargs_p.h b/src/corelib/kernel/qcorecmdlineargs_p.h index b9f1ef6317..849d72901d 100644 --- a/src/corelib/kernel/qcorecmdlineargs_p.h +++ b/src/corelib/kernel/qcorecmdlineargs_p.h @@ -60,7 +60,6 @@ # include // first to suppress min, max macros. # include # else -# include "QtCore/qvector.h" # include # endif diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h index 581df9242c..5757cc764c 100644 --- a/src/corelib/kernel/qeventdispatcher_unix_p.h +++ b/src/corelib/kernel/qeventdispatcher_unix_p.h @@ -141,10 +141,10 @@ public: void setSocketNotifierPending(QSocketNotifier *notifier); QThreadPipe threadPipe; - QVector pollfds; + QList pollfds; QHash socketNotifiers; - QVector pendingNotifiers; + QList pendingNotifiers; QTimerInfoList timerList; QAtomicInt interrupt; // bool diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index ae6e4d3452..d3285b292f 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -53,14 +53,13 @@ // #include +#include "QtCore/qcoreevent.h" +#include "QtCore/qlist.h" #include "QtCore/qobject.h" #include "QtCore/qpointer.h" +#include "QtCore/qreadwritelock.h" #include "QtCore/qsharedpointer.h" -#include "QtCore/qcoreevent.h" -#include "QtCore/qlist.h" -#include "QtCore/qvector.h" #include "QtCore/qvariant.h" -#include "QtCore/qreadwritelock.h" QT_BEGIN_NAMESPACE @@ -105,8 +104,8 @@ public: { ExtraData() {} QList propertyNames; - QVector propertyValues; - QVector runningTimers; + QList propertyValues; + QList runningTimers; QList > eventFilters; QString objectName; }; diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h index 831390de1f..e6af23e7ed 100644 --- a/src/corelib/mimetypes/qmimedatabase_p.h +++ b/src/corelib/mimetypes/qmimedatabase_p.h @@ -60,8 +60,8 @@ QT_REQUIRE_CONFIG(mimetype); #include "qmimeglobpattern_p.h" #include +#include #include -#include #include #include diff --git a/src/corelib/plugin/qpluginloader.h b/src/corelib/plugin/qpluginloader.h index 5e417249a4..81b78aa532 100644 --- a/src/corelib/plugin/qpluginloader.h +++ b/src/corelib/plugin/qpluginloader.h @@ -67,7 +67,7 @@ public: QJsonObject metaData() const; static QObjectList staticInstances(); - static QVector staticPlugins(); + static QList staticPlugins(); bool load(); bool unload(); @@ -93,7 +93,7 @@ class Q_CORE_EXPORT QPluginLoader { public: static QObjectList staticInstances(); - static QVector staticPlugins(); + static QList staticPlugins(); }; #endif // QT_CONFIG(library) diff --git a/src/corelib/serialization/qcbormap.h b/src/corelib/serialization/qcbormap.h index 1199cb47b7..7e1a4cb485 100644 --- a/src/corelib/serialization/qcbormap.h +++ b/src/corelib/serialization/qcbormap.h @@ -188,7 +188,7 @@ public: qsizetype size() const noexcept Q_DECL_PURE_FUNCTION; bool isEmpty() const { return size() == 0; } void clear(); - QVector keys() const; + QList keys() const; QCborValue value(qint64 key) const { const_iterator it = find(key); return it == end() ? QCborValue() : it.value(); } diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h index 487173e421..b8c3dce294 100644 --- a/src/corelib/serialization/qcborvalue.h +++ b/src/corelib/serialization/qcborvalue.h @@ -51,7 +51,6 @@ #include #include #include -#include // See qcborcommon.h for why we check #if defined(QT_X11_DEFINES_FOUND) diff --git a/src/corelib/serialization/qcborvalue_p.h b/src/corelib/serialization/qcborvalue_p.h index cad605bd1a..3b1e45a2a8 100644 --- a/src/corelib/serialization/qcborvalue_p.h +++ b/src/corelib/serialization/qcborvalue_p.h @@ -131,7 +131,7 @@ public: QByteArray::size_type usedData = 0; QByteArray data; - QVector elements; + QList elements; void deref() { if (!ref.deref()) delete this; } void compact(qsizetype reserved); diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h index c11d6803ac..d00fb5e7d8 100644 --- a/src/corelib/serialization/qdatastream.h +++ b/src/corelib/serialization/qdatastream.h @@ -406,13 +406,13 @@ operator>>(QDataStream &s, T &t) { return s >> reinterpret_cast::type &>(t); } template -inline QDataStream &operator>>(QDataStream &s, QVector &v) +inline QDataStream &operator>>(QDataStream &s, QList &v) { return QtPrivate::readArrayBasedContainer(s, v); } template -inline QDataStream &operator<<(QDataStream &s, const QVector &v) +inline QDataStream &operator<<(QDataStream &s, const QList &v) { return QtPrivate::writeSequentialContainer(s, v); } diff --git a/src/corelib/serialization/qjson_p.h b/src/corelib/serialization/qjson_p.h index d2bbf928d0..4589284ef3 100644 --- a/src/corelib/serialization/qjson_p.h +++ b/src/corelib/serialization/qjson_p.h @@ -113,7 +113,7 @@ struct ObjectIterator Element m_value; }; - using difference_type = typename QVector::difference_type; + using difference_type = typename QList::difference_type; using iterator_category = std::random_access_iterator_tag; ObjectIterator() = default; @@ -182,8 +182,8 @@ inline bool operator==( return a.elementsIterator() == b.elementsIterator(); } -using KeyIterator = ObjectIterator::iterator>; -using ConstKeyIterator = ObjectIterator::const_iterator>; +using KeyIterator = ObjectIterator::iterator>; +using ConstKeyIterator = ObjectIterator::const_iterator>; template<> inline KeyIterator::reference &KeyIterator::reference::operator=(const KeyIterator::value_type &value) diff --git a/src/corelib/serialization/qxmlstream.h b/src/corelib/serialization/qxmlstream.h index fdc28a97e1..44f33b111b 100644 --- a/src/corelib/serialization/qxmlstream.h +++ b/src/corelib/serialization/qxmlstream.h @@ -44,9 +44,9 @@ #ifndef QT_NO_XMLSTREAM -#include -#include +#include #include +#include QT_BEGIN_NAMESPACE @@ -113,7 +113,7 @@ public: Q_DECLARE_TYPEINFO(QXmlStreamAttribute, Q_MOVABLE_TYPE); -class Q_CORE_EXPORT QXmlStreamAttributes : public QVector +class Q_CORE_EXPORT QXmlStreamAttributes : public QList { public: inline QXmlStreamAttributes() {} @@ -140,7 +140,7 @@ public: return !value(namespaceUri, name).isNull(); } - using QVector::append; + using QList::append; }; class Q_CORE_EXPORT QXmlStreamNamespaceDeclaration { @@ -164,7 +164,7 @@ public: }; Q_DECLARE_TYPEINFO(QXmlStreamNamespaceDeclaration, Q_MOVABLE_TYPE); -typedef QVector QXmlStreamNamespaceDeclarations; +typedef QList QXmlStreamNamespaceDeclarations; class Q_CORE_EXPORT QXmlStreamNotationDeclaration { QXmlStreamStringRef m_name, m_systemId, m_publicId; @@ -188,7 +188,7 @@ public: }; Q_DECLARE_TYPEINFO(QXmlStreamNotationDeclaration, Q_MOVABLE_TYPE); -typedef QVector QXmlStreamNotationDeclarations; +typedef QList QXmlStreamNotationDeclarations; class Q_CORE_EXPORT QXmlStreamEntityDeclaration { QXmlStreamStringRef m_name, m_notationName, m_systemId, m_publicId, m_value; @@ -217,8 +217,7 @@ public: }; Q_DECLARE_TYPEINFO(QXmlStreamEntityDeclaration, Q_MOVABLE_TYPE); -typedef QVector QXmlStreamEntityDeclarations; - +typedef QList QXmlStreamEntityDeclarations; class Q_CORE_EXPORT QXmlStreamEntityResolver { diff --git a/src/corelib/text/qcollator_p.h b/src/corelib/text/qcollator_p.h index 304c7135e1..b1a483c4e2 100644 --- a/src/corelib/text/qcollator_p.h +++ b/src/corelib/text/qcollator_p.h @@ -54,7 +54,7 @@ #include #include "qcollator.h" -#include +#include #if QT_CONFIG(icu) #include #elif defined(Q_OS_MACOS) @@ -72,7 +72,7 @@ const CollatorType NoCollator = nullptr; #elif defined(Q_OS_MACOS) typedef CollatorRef CollatorType; -typedef QVector CollatorKeyType; +typedef QList CollatorKeyType; const CollatorType NoCollator = 0; #elif defined(Q_OS_WIN) @@ -81,7 +81,7 @@ typedef int CollatorType; const CollatorType NoCollator = 0; #else // posix - ignores CollatorType collator, only handles system locale -typedef QVector CollatorKeyType; +typedef QList CollatorKeyType; typedef bool CollatorType; const CollatorType NoCollator = false; #endif diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index 199650be0b..95376f79c0 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -580,22 +580,20 @@ public: QStringList split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT - QVector splitRef(const QString &sep, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + QList splitRef(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT QStringList split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT - QVector splitRef(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + QList splitRef(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; #ifndef QT_NO_REGULAREXPRESSION Q_REQUIRED_RESULT QStringList split(const QRegularExpression &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const; Q_REQUIRED_RESULT - QVector splitRef(const QRegularExpression &sep, - Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const; + QList splitRef(const QRegularExpression &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const; #endif template @@ -647,7 +645,7 @@ public: Q_REQUIRED_RESULT QByteArray toUtf8() const; Q_REQUIRED_RESULT QByteArray toLocal8Bit() const; #endif - Q_REQUIRED_RESULT QVector toUcs4() const; + Q_REQUIRED_RESULT QList toUcs4() const; // note - this are all inline so we can benefit from strlen() compile time optimizations static inline QString fromLatin1(const char *str, int size = -1) @@ -1414,11 +1412,11 @@ public: int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT - QVector split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + QList split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT - QVector split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + QList split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; Q_REQUIRED_RESULT QStringRef left(int n) const; Q_REQUIRED_RESULT QStringRef right(int n) const; @@ -1480,7 +1478,7 @@ public: Q_REQUIRED_RESULT QByteArray toLatin1() const; Q_REQUIRED_RESULT QByteArray toUtf8() const; Q_REQUIRED_RESULT QByteArray toLocal8Bit() const; - Q_REQUIRED_RESULT QVector toUcs4() const; + Q_REQUIRED_RESULT QList toUcs4() const; inline void clear() { m_string = nullptr; m_position = m_size = 0; } QString toString() const; diff --git a/src/corelib/text/qstringalgorithms.h b/src/corelib/text/qstringalgorithms.h index 3b67739232..4a0f7dce9a 100644 --- a/src/corelib/text/qstringalgorithms.h +++ b/src/corelib/text/qstringalgorithms.h @@ -93,7 +93,7 @@ Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype count(QStringView Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLatin1(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToUtf8(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLocal8Bit(QStringView str); -Q_REQUIRED_RESULT Q_CORE_EXPORT QVector convertToUcs4(QStringView str); +Q_REQUIRED_RESULT Q_CORE_EXPORT QList convertToUcs4(QStringView str); Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isRightToLeft(QStringView string) noexcept; diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index d042fbbdab..4db23db57f 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -329,8 +329,7 @@ public: this->needleView(needle), sb, cs} {} - template , - if_compatible_container = true> + template, if_compatible_container = true> Container toContainer(Container &&c = {}) const & { for (auto e : *this) @@ -338,9 +337,8 @@ public: return c; } - template , - if_compatible_container = true, - if_haystack_not_pinned = true> + template, if_compatible_container = true, + if_haystack_not_pinned = true> Container toContainer(Container &&c = {}) const && { for (auto e : *this) diff --git a/src/corelib/text/qstringview.h b/src/corelib/text/qstringview.h index 8047050b8c..17b60fdc42 100644 --- a/src/corelib/text/qstringview.h +++ b/src/corelib/text/qstringview.h @@ -253,7 +253,7 @@ public: Q_REQUIRED_RESULT QByteArray toLatin1() const { return QtPrivate::convertToLatin1(*this); } Q_REQUIRED_RESULT QByteArray toUtf8() const { return QtPrivate::convertToUtf8(*this); } Q_REQUIRED_RESULT QByteArray toLocal8Bit() const { return QtPrivate::convertToLocal8Bit(*this); } - Q_REQUIRED_RESULT inline QVector toUcs4() const; // defined in qvector.h + Q_REQUIRED_RESULT inline QList toUcs4() const; // defined in qlist.h Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar at(qsizetype n) const { return (*this)[n]; } diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index 75c4cae0ca..2e15cbb013 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -237,7 +237,7 @@ public: inline void reportAndMoveResult(T &&result, int index = -1); inline void reportResult(T &&result, int index = -1); inline void reportResult(const T &result, int index = -1); - inline void reportResults(const QVector &results, int beginIndex = -1, int count = -1); + inline void reportResults(const QList &results, int beginIndex = -1, int count = -1); inline void reportFinished(const T *result); void reportFinished() { @@ -300,8 +300,8 @@ inline void QFutureInterface::reportResult(const T &result, int index) reportResult(&result, index); } -template -inline void QFutureInterface::reportResults(const QVector &_results, int beginIndex, int count) +template +inline void QFutureInterface::reportResults(const QList &_results, int beginIndex, int count) { std::lock_guard locker{mutex()}; if (this->queryState(Canceled) || this->queryState(Finished)) { @@ -418,7 +418,7 @@ public: inline QFuture future(); // implemented in qfuture.h void reportResult(const void *, int) { } - void reportResults(const QVector &, int) { } + void reportResults(const QList &, int) { } void reportFinished(const void * = nullptr) { QFutureInterfaceBase::reportFinished(); diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h index c150876e74..523c745a8e 100644 --- a/src/corelib/thread/qresultstore.h +++ b/src/corelib/thread/qresultstore.h @@ -49,16 +49,14 @@ QT_REQUIRE_CONFIG(future); QT_BEGIN_NAMESPACE - /* ResultStore stores indexed results. Results can be added and retrieved - either individually batched in a QVector. Retriveing results and checking + either individually batched in a QList. Retriveing results and checking which indexes are in the store can be done either by iterating or by random accees. In addition results kan be removed from the front of the store, either individually or in batches. */ - namespace QtPrivate { class ResultItem @@ -116,7 +114,7 @@ public: const T *pointer() const { if (mapIterator.value().isVector()) - return &(reinterpret_cast *>(mapIterator.value().result)->at(m_vectorIndex)); + return &(reinterpret_cast *>(mapIterator.value().result)->at(m_vectorIndex)); else return reinterpret_cast(mapIterator.value().result); } @@ -169,19 +167,19 @@ public: return addResult(index, static_cast(new T(std::move_if_noexcept(result)))); } - template - int addResults(int index, const QVector *results) + template + int addResults(int index, const QList *results) { - return addResults(index, new QVector(*results), results->count(), results->count()); + return addResults(index, new QList(*results), results->count(), results->count()); } - template - int addResults(int index, const QVector *results, int totalCount) + template + int addResults(int index, const QList *results, int totalCount) { if (m_filterMode == true && results->count() != totalCount && 0 == results->count()) return addResults(index, nullptr, 0, totalCount); - return addResults(index, new QVector(*results), results->count(), totalCount); + return addResults(index, new QList(*results), results->count(), totalCount); } int addCanceledResult(int index) @@ -192,7 +190,7 @@ public: template int addCanceledResults(int index, int _count) { - QVector empty; + QList empty; return addResults(index, &empty, _count); } @@ -202,7 +200,7 @@ public: QMap::const_iterator mapIterator = m_results.constBegin(); while (mapIterator != m_results.constEnd()) { if (mapIterator.value().isVector()) - delete reinterpret_cast *>(mapIterator.value().result); + delete reinterpret_cast *>(mapIterator.value().result); else delete reinterpret_cast(mapIterator.value().result); ++mapIterator; diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 9255b05104..c853bd1de4 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -94,7 +94,7 @@ inline bool operator<(const QPostEvent &first, const QPostEvent &second) // This class holds the list of posted events. // The list has to be kept sorted by priority -class QPostEventList : public QVector +class QPostEventList : public QList { public: // recursion == recursion count for sendPostedEvents() @@ -107,9 +107,7 @@ public: QMutex mutex; - inline QPostEventList() - : QVector(), recursion(0), startOffset(0), insertionOffset(0) - { } + inline QPostEventList() : QList(), recursion(0), startOffset(0), insertionOffset(0) { } void addEvent(const QPostEvent &ev) { int priority = ev.priority; @@ -129,8 +127,8 @@ public: } private: //hides because they do not keep that list sorted. addEvent must be used - using QVector::append; - using QVector::insert; + using QList::append; + using QList::insert; }; #if QT_CONFIG(thread) @@ -292,7 +290,7 @@ public: QAtomicPointer thread; QAtomicPointer threadId; QAtomicPointer eventDispatcher; - QVector tls; + QList tls; FlaggedDebugSignatures flaggedSignatures; bool quitNow; diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h index 01852d8366..f019b480f5 100644 --- a/src/corelib/thread/qthreadpool_p.h +++ b/src/corelib/thread/qthreadpool_p.h @@ -174,7 +174,7 @@ public: QSet allThreads; QQueue waitingThreads; QQueue expiredThreads; - QVector queue; + QList queue; QWaitCondition noActiveThreads; int expiryTimeout = 30000; diff --git a/src/corelib/time/qdatetimeparser_p.h b/src/corelib/time/qdatetimeparser_p.h index 9a8bb7d5d9..43fe4f261e 100644 --- a/src/corelib/time/qdatetimeparser_p.h +++ b/src/corelib/time/qdatetimeparser_p.h @@ -54,15 +54,15 @@ #include #include "qplatformdefs.h" #include "QtCore/qatomic.h" +#include "QtCore/qcalendar.h" +#include "QtCore/qcoreapplication.h" #include "QtCore/qdatetime.h" -#include "QtCore/qstringlist.h" +#include "QtCore/qlist.h" #include "QtCore/qlocale.h" -#include "QtCore/qcalendar.h" +#include "QtCore/qstringlist.h" #ifndef QT_BOOTSTRAPPED # include "QtCore/qvariant.h" #endif -#include "QtCore/qvector.h" -#include "QtCore/qcoreapplication.h" QT_REQUIRE_CONFIG(datetimeparser); @@ -291,7 +291,7 @@ protected: // for the benefit of QDateTimeEditPrivate */ mutable int cachedDay; mutable QString text; - QVector sectionNodes; + QList sectionNodes; SectionNode first, last, none, popup; QStringList separators; QString displayFormat; diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h index 62ecee49bb..11070cc2eb 100644 --- a/src/corelib/time/qtimezone.h +++ b/src/corelib/time/qtimezone.h @@ -87,7 +87,7 @@ public: int standardTimeOffset; int daylightTimeOffset; }; - typedef QVector OffsetDataList; + typedef QList OffsetDataList; QTimeZone() noexcept; explicit QTimeZone(const QByteArray &ianaId); diff --git a/src/corelib/time/qtimezoneprivate_p.h b/src/corelib/time/qtimezoneprivate_p.h index f1b7fea1f9..3f08fc15a6 100644 --- a/src/corelib/time/qtimezoneprivate_p.h +++ b/src/corelib/time/qtimezoneprivate_p.h @@ -52,9 +52,9 @@ // We mean it. // +#include "qlist.h" #include "qtimezone.h" #include "private/qlocale_p.h" -#include "qvector.h" #if QT_CONFIG(icu) #include @@ -85,7 +85,7 @@ public: int standardTimeOffset; int daylightTimeOffset; }; - typedef QVector DataList; + typedef QList DataList; // Create null time zone QTimeZonePrivate(); @@ -294,8 +294,8 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzT // cached, avoiding the need to re-parse them from disk constantly. struct QTzTimeZoneCacheEntry { - QVector m_tranTimes; - QVector m_tranRules; + QList m_tranTimes; + QList m_tranRules; QList m_abbreviations; QByteArray m_posixRule; }; @@ -344,14 +344,14 @@ public: private: void init(const QByteArray &ianaId); - QVector getPosixTransitions(qint64 msNear) const; + QList getPosixTransitions(qint64 msNear) const; Data dataForTzTransition(QTzTransitionTime tran) const; #if QT_CONFIG(icu) mutable QSharedDataPointer m_icu; #endif QTzTimeZoneCacheEntry cached_data; - QVector tranCache() const { return cached_data.m_tranTimes; } + QList tranCache() const { return cached_data.m_tranTimes; } }; #endif // Q_OS_UNIX diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h index 8cf6598f10..ac7760be0b 100644 --- a/src/corelib/tools/qcache.h +++ b/src/corelib/tools/qcache.h @@ -205,11 +205,11 @@ public: inline qsizetype size() const noexcept { return d.size; } inline qsizetype count() const noexcept { return d.size; } inline bool isEmpty() const noexcept { return !d.size; } - inline QVector keys() const + inline QList keys() const { - QVector k; + QList k; if (d.size) { - k.reserve(typename QVector::size_type(d.size)); + k.reserve(typename QList::size_type(d.size)); for (auto it = d.begin(); it != d.end(); ++it) k << it.node()->key; } diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h index 81833a758f..e6ee7b56d5 100644 --- a/src/corelib/tools/qeasingcurve.h +++ b/src/corelib/tools/qeasingcurve.h @@ -44,8 +44,8 @@ QT_REQUIRE_CONFIG(easingcurve); +#include #include -#include QT_BEGIN_NAMESPACE @@ -100,7 +100,7 @@ public: void addCubicBezierSegment(const QPointF & c1, const QPointF & c2, const QPointF & endPoint); void addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qreal b); - QVector toCubicSpline() const; + QList toCubicSpline() const; Type type() const; void setType(Type type); diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h index 82a1068d34..bf0efb2543 100644 --- a/src/corelib/tools/qflatmap_p.h +++ b/src/corelib/tools/qflatmap_p.h @@ -51,7 +51,7 @@ // We mean it. // -#include "qvector.h" +#include "qlist.h" #include #include @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE /* QFlatMap provides an associative container backed by sorted sequential - containers. By default, QVector is used. + containers. By default, QList is used. Keys and values are stored in two separate containers. This provides improved cache locality for key iteration and makes keys() and values() fast @@ -105,10 +105,8 @@ public: } }; -template , - class KeyContainer = QVector, - class MappedContainer = QVector> +template, class KeyContainer = QList, + class MappedContainer = QList> class QFlatMap : private QFlatMapValueCompare { using full_map_t = QFlatMap; diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 2c39a9dfc8..2de3989eb2 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -40,12 +40,12 @@ #ifndef QHASH_H #define QHASH_H -#include -#include -#include -#include #include +#include +#include +#include #include +#include #include @@ -897,13 +897,10 @@ public: return value(key); } - QVector keys() const - { - return QVector(keyBegin(), keyEnd()); - } - QVector keys(const T &value) const + QList keys() const { return QList(keyBegin(), keyEnd()); } + QList keys(const T &value) const { - QVector res; + QList res; const_iterator i = begin(); while (i != end()) { if (i.value() == value) @@ -912,10 +909,7 @@ public: } return res; } - QVector values() const - { - return QVector(begin(), end()); - } + QList values() const { return QList(begin(), end()); } class const_iterator; @@ -1381,9 +1375,9 @@ public: return value(key); } - QVector uniqueKeys() const + QList uniqueKeys() const { - QVector res; + QList res; if (d) { auto i = d->begin(); while (i != d->end()) { @@ -1394,13 +1388,10 @@ public: return res; } - QVector keys() const + QList keys() const { return QList(keyBegin(), keyEnd()); } + QList keys(const T &value) const { - return QVector(keyBegin(), keyEnd()); - } - QVector keys(const T &value) const - { - QVector res; + QList res; const_iterator i = begin(); while (i != end()) { if (i.value()->contains(value)) @@ -1409,13 +1400,10 @@ public: } return res; } - QVector values() const - { - return QVector(begin(), end()); - } - QVector values(const Key &key) const + QList values() const { return QList(begin(), end()); } + QList values(const Key &key) const { - QVector values; + QList values; if (d) { Node *n = d->findNode(key); if (n) { diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h index 838cb31697..85a3882a3c 100644 --- a/src/corelib/tools/qringbuffer_p.h +++ b/src/corelib/tools/qringbuffer_p.h @@ -53,7 +53,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -265,7 +265,7 @@ public: } private: - QVector buffers; + QList buffers; qint64 bufferSize; int basicBlockSize; }; diff --git a/src/corelib/tools/qstack.h b/src/corelib/tools/qstack.h index e59212aa2a..a0e39f8ece 100644 --- a/src/corelib/tools/qstack.h +++ b/src/corelib/tools/qstack.h @@ -40,18 +40,17 @@ #ifndef QSTACK_H #define QSTACK_H -#include +#include QT_BEGIN_NAMESPACE - template -class QStack : public QVector +class QStack : public QList { public: // compiler-generated special member functions are fine! - inline void swap(QStack &other) noexcept { QVector::swap(other); } // prevent QVector<->QStack swaps - inline void push(const T &t) { QVector::append(t); } + inline void swap(QStack &other) noexcept { QList::swap(other); } // prevent QList<->QStack swaps + inline void push(const T &t) { QList::append(t); } T pop(); T &top(); const T &top() const; diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index f4e384c8dc..f8a2d8eae8 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -42,10 +42,10 @@ #ifndef QVERSIONNUMBER_H #define QVERSIONNUMBER_H +#include +#include #include #include -#include -#include #include #include @@ -84,24 +84,24 @@ class QVersionNumber union { quintptr dummy; qint8 inline_segments[sizeof(void*)]; - QVector *pointer_segments; + QList *pointer_segments; }; // set the InlineSegmentMarker and set length to zero SegmentStorage() noexcept : dummy(1) {} - SegmentStorage(const QVector &seg) + SegmentStorage(const QList &seg) { if (dataFitsInline(seg.begin(), seg.size())) setInlineData(seg.begin(), seg.size()); else - pointer_segments = new QVector(seg); + pointer_segments = new QList(seg); } SegmentStorage(const SegmentStorage &other) { if (other.isUsingPointer()) - pointer_segments = new QVector(*other.pointer_segments); + pointer_segments = new QList(*other.pointer_segments); else dummy = other.dummy; } @@ -111,7 +111,7 @@ class QVersionNumber if (isUsingPointer() && other.isUsingPointer()) { *pointer_segments = *other.pointer_segments; } else if (other.isUsingPointer()) { - pointer_segments = new QVector(*other.pointer_segments); + pointer_segments = new QList(*other.pointer_segments); } else { if (isUsingPointer()) delete pointer_segments; @@ -132,19 +132,19 @@ class QVersionNumber return *this; } - explicit SegmentStorage(QVector &&seg) + explicit SegmentStorage(QList &&seg) { if (dataFitsInline(seg.begin(), seg.size())) setInlineData(seg.begin(), seg.size()); else - pointer_segments = new QVector(std::move(seg)); + pointer_segments = new QList(std::move(seg)); } SegmentStorage(std::initializer_list args) { if (dataFitsInline(args.begin(), int(args.size()))) { setInlineData(args.begin(), int(args.size())); } else { - pointer_segments = new QVector(args); + pointer_segments = new QList(args); } } @@ -218,15 +218,11 @@ public: inline QVersionNumber() noexcept : m_segments() {} - inline explicit QVersionNumber(const QVector &seg) - : m_segments(seg) - {} + inline explicit QVersionNumber(const QList &seg) : m_segments(seg) { } // compiler-generated copy/move ctor/assignment operators and the destructor are ok - explicit QVersionNumber(QVector &&seg) - : m_segments(std::move(seg)) - {} + explicit QVersionNumber(QList &&seg) : m_segments(std::move(seg)) { } inline QVersionNumber(std::initializer_list args) : m_segments(args) @@ -258,7 +254,7 @@ public: Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const; - Q_REQUIRED_RESULT Q_CORE_EXPORT QVector segments() const; + Q_REQUIRED_RESULT Q_CORE_EXPORT QList segments() const; Q_REQUIRED_RESULT inline int segmentAt(int index) const noexcept { return (m_segments.size() > index) ? m_segments.at(index) : 0; } diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 7c806ed78d..74725c8f18 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -460,7 +460,7 @@ void tst_QObject::connectSlotsByName() sender.setObjectName("Sender"); QTest::ignoreMessage(QtWarningMsg, "QMetaObject::connectSlotsByName: No matching signal for on_child_signal()"); - QTest::ignoreMessage(QtWarningMsg, "QMetaObject::connectSlotsByName: Connecting slot on_Sender_signalManyParams() with the first of the following compatible signals: QVector(\"signalManyParams(int,int,int,QString,bool)\", \"signalManyParams(int,int,int,QString,bool,bool)\")"); + QTest::ignoreMessage(QtWarningMsg, "QMetaObject::connectSlotsByName: Connecting slot on_Sender_signalManyParams() with the first of the following compatible signals: QList(\"signalManyParams(int,int,int,QString,bool)\", \"signalManyParams(int,int,int,QString,bool,bool)\")"); QMetaObject::connectSlotsByName(&receiver); receiver.called_slots.clear(); -- cgit v1.2.3