diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-22 11:06:12 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-25 22:30:59 +0200 |
commit | 0475460102411979ab51c365cb2bec2c05b69cb4 (patch) | |
tree | 73b7dbe85249da2bd339cd19b0c584894d3901c7 /src/corelib/itemmodels | |
parent | e114e580e751b5deb19ab489a8b11f830ff6356f (diff) |
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 <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/itemmodels')
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.h | 9 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel_p.h | 7 | ||||
-rw-r--r-- | src/corelib/itemmodels/qconcatenatetablesproxymodel.h | 3 | ||||
-rw-r--r-- | src/corelib/itemmodels/qidentityproxymodel.h | 2 | ||||
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel.h | 5 | ||||
-rw-r--r-- | src/corelib/itemmodels/qitemselectionmodel_p.h | 8 | ||||
-rw-r--r-- | src/corelib/itemmodels/qsortfilterproxymodel.h | 4 | ||||
-rw-r--r-- | src/corelib/itemmodels/qtransposeproxymodel_p.h | 6 |
8 files changed, 24 insertions, 20 deletions
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 <QtCore/qvariant.h> -#include <QtCore/qobject.h> #include <QtCore/qhash.h> -#include <QtCore/qvector.h> +#include <QtCore/qlist.h> +#include <QtCore/qobject.h> +#include <QtCore/qvariant.h> 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<int> &roles = QVector<int>()); + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, + const QList<int> &roles = QList<int>()); void headerDataChanged(Qt::Orientation orientation, int first, int last); void layoutChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint); void layoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(), 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<QPersistentModelIndexData *> &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation); + void movePersistentIndexes(const QList<QPersistentModelIndexData *> &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<QModelIndex, QPersistentModelIndexData *> indexes; - QStack<QVector<QPersistentModelIndexData *> > moved; - QStack<QVector<QPersistentModelIndexData *> > invalidated; + QStack<QList<QPersistentModelIndexData *>> moved; + QStack<QList<QPersistentModelIndexData *>> 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<int> &roles)) + Q_PRIVATE_SLOT(d_func(), + void _q_slotDataChanged(const QModelIndex &from, const QModelIndex &to, const QList<int> &roles)) Q_PRIVATE_SLOT(d_func(), void _q_slotSourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>, QAbstractItemModel::LayoutChangeHint)) Q_PRIVATE_SLOT(d_func(), void _q_slotSourceLayoutChanged(const QList<QPersistentModelIndex> &, 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<int>)) + Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(QModelIndex, QModelIndex, QList<int>)) 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<QPersistentModelIndex> &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 <QtCore/qglobal.h> -#include <QtCore/qset.h> -#include <QtCore/qvector.h> -#include <QtCore/qlist.h> #include <QtCore/qabstractitemmodel.h> +#include <QtCore/qlist.h> +#include <QtCore/qset.h> 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<QPersistentModelIndex> savedPersistentIndexes; - QVector<QPersistentModelIndex> savedPersistentCurrentIndexes; - QVector<QPair<QPersistentModelIndex, uint> > savedPersistentRowLengths; - QVector<QPair<QPersistentModelIndex, uint> > savedPersistentCurrentRowLengths; + QList<QPersistentModelIndex> savedPersistentIndexes; + QList<QPersistentModelIndex> savedPersistentCurrentIndexes; + QList<QPair<QPersistentModelIndex, uint>> savedPersistentRowLengths; + QList<QPair<QPersistentModelIndex, uint>> 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<int> &roles)) + Q_PRIVATE_SLOT(d_func(), + void _q_sourceDataChanged(const QModelIndex &source_top_left, const QModelIndex &source_bottom_right, + const QList<int> &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<QMetaObject::Connection> sourceConnections; - QVector<QPersistentModelIndex> layoutChangePersistentIndexes; + QList<QMetaObject::Connection> sourceConnections; + QList<QPersistentModelIndex> layoutChangePersistentIndexes; QModelIndexList layoutChangeProxyIndexes; QModelIndex uncheckedMapToSource(const QModelIndex &proxyIndex) const; QModelIndex uncheckedMapFromSource(const QModelIndex &sourceIndex) const; void onLayoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint); void onLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint); - void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector<int>& roles); + void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &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); |