Replace QVector with QList
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include <QLocale>
|
||||
#include <QPainter>
|
||||
#include <QPalette>
|
||||
#include <QVector>
|
||||
#include <QRect>
|
||||
#include <QPen>
|
||||
#include <QPoint>
|
||||
@@ -133,7 +132,7 @@ void GroupedIconView::rowsInserted(const QModelIndex &parent, int start, int end
|
||||
LayoutItems();
|
||||
}
|
||||
|
||||
void GroupedIconView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int>&) {
|
||||
void GroupedIconView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int>&) {
|
||||
QListView::dataChanged(topLeft, bottomRight);
|
||||
LayoutItems();
|
||||
}
|
||||
@@ -253,7 +252,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) {
|
||||
QPainter painter(viewport());
|
||||
|
||||
const QRect viewport_rect(e->rect().translated(horizontalOffset(), verticalOffset()));
|
||||
QVector<QModelIndex> toBeRendered = IntersectingItems(viewport_rect);
|
||||
QList<QModelIndex> toBeRendered = IntersectingItems(viewport_rect);
|
||||
|
||||
const QModelIndex current = currentIndex();
|
||||
const QAbstractItemModel *itemModel = model();
|
||||
@@ -265,8 +264,8 @@ void GroupedIconView::paintEvent(QPaintEvent *e) {
|
||||
|
||||
int maxSize = (flow() == TopToBottom) ? viewport()->size().width() - 2 * spacing() : viewport()->size().height() - 2 * spacing();
|
||||
|
||||
QVector<QModelIndex>::const_iterator end = toBeRendered.constEnd();
|
||||
for (QVector<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
|
||||
QList<QModelIndex>::const_iterator end = toBeRendered.constEnd();
|
||||
for (QList<QModelIndex>::const_iterator it = toBeRendered.constBegin(); it != end; ++it) {
|
||||
if (!it->isValid()) {
|
||||
continue;
|
||||
}
|
||||
@@ -325,7 +324,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) {
|
||||
|
||||
void GroupedIconView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) {
|
||||
|
||||
const QVector<QModelIndex> indexes(IntersectingItems(rect.translated(horizontalOffset(), verticalOffset())));
|
||||
const QList<QModelIndex> indexes(IntersectingItems(rect.translated(horizontalOffset(), verticalOffset())));
|
||||
|
||||
QItemSelection selection;
|
||||
selection.reserve(indexes.count());
|
||||
@@ -338,9 +337,9 @@ void GroupedIconView::setSelection(const QRect &rect, QItemSelectionModel::Selec
|
||||
|
||||
}
|
||||
|
||||
QVector<QModelIndex> GroupedIconView::IntersectingItems(const QRect rect) const {
|
||||
QList<QModelIndex> GroupedIconView::IntersectingItems(const QRect rect) const {
|
||||
|
||||
QVector<QModelIndex> ret;
|
||||
QList<QModelIndex> ret;
|
||||
|
||||
const int count = static_cast<int>(visual_rects_.count());
|
||||
for (int i = 0; i < count; ++i) {
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
#include <QAbstractItemModel>
|
||||
#include <QAbstractItemView>
|
||||
#include <QItemSelectionModel>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QFont>
|
||||
#include <QPalette>
|
||||
#include <QPoint>
|
||||
#include <QRect>
|
||||
#include <QRegion>
|
||||
#include <QVector>
|
||||
|
||||
class QWidget;
|
||||
class QPainter;
|
||||
@@ -89,7 +89,7 @@ class GroupedIconView : public QListView {
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
|
||||
// QAbstractItemView
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int>& = QVector<int>()) override;
|
||||
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int>& = QList<int>()) override;
|
||||
QModelIndex indexAt(const QPoint &p) const override;
|
||||
void rowsInserted(const QModelIndex &parent, int start, int end) override;
|
||||
void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
|
||||
@@ -107,14 +107,14 @@ class GroupedIconView : public QListView {
|
||||
};
|
||||
|
||||
// Returns the items that are wholly or partially inside the rect.
|
||||
QVector<QModelIndex> IntersectingItems(const QRect rect) const;
|
||||
QList<QModelIndex> IntersectingItems(const QRect rect) const;
|
||||
|
||||
// Returns the index of the item above (d=-1) or below (d=+1) the given item.
|
||||
int IndexAboveOrBelow(int index, const int d) const;
|
||||
|
||||
MultiSortFilterProxy *proxy_model_;
|
||||
QVector<QRect> visual_rects_;
|
||||
QVector<Header> headers_;
|
||||
QList<QRect> visual_rects_;
|
||||
QList<Header> headers_;
|
||||
|
||||
const int default_header_height_;
|
||||
int header_spacing_;
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include <QHeaderView>
|
||||
#include <QAbstractItemModel>
|
||||
#include <QIODevice>
|
||||
#include <QList>
|
||||
#include <QByteArray>
|
||||
#include <QDataStream>
|
||||
#include <QList>
|
||||
#include <QResizeEvent>
|
||||
#include <QMouseEvent>
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <QHeaderView>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
class QWidget;
|
||||
class QAbstractItemModel;
|
||||
@@ -92,7 +91,7 @@ class StretchHeaderView : public QHeaderView {
|
||||
|
||||
private:
|
||||
bool stretch_enabled_;
|
||||
QVector<ColumnWidthType> column_widths_;
|
||||
QList<ColumnWidthType> column_widths_;
|
||||
|
||||
bool in_mouse_move_event_;
|
||||
int forced_resize_logical_index_;
|
||||
|
||||
Reference in New Issue
Block a user