summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-22 10:12:38 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-23 14:01:11 +0200
commit29c99bddbf48f97b054a34354f55b36a3f84a62c (patch)
treeca0116c45cc3cb04e13a953316f468012d3dc2d2 /examples/widgets
parentd7efb2a419a88c8f512b98194c8f7bc81dbe942b (diff)
Use QList instead of QVector in examples
Task-number: QTBUG-84469 Change-Id: Id14119168bb1bf11f99bda7ef6ee9cf51bcfab2e Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/animation/stickman/animation.cpp2
-rw-r--r--examples/widgets/animation/stickman/animation.h4
-rw-r--r--examples/widgets/animation/sub-attaq/animationmanager.h2
-rw-r--r--examples/widgets/animation/sub-attaq/graphicsscene.h4
-rw-r--r--examples/widgets/doc/src/addressbook.qdoc6
-rw-r--r--examples/widgets/doc/src/calendar.qdoc2
-rw-r--r--examples/widgets/doc/src/icons.qdoc2
-rw-r--r--examples/widgets/doc/src/syntaxhighlighter.qdoc4
-rw-r--r--examples/widgets/doc/src/tooltips.qdoc2
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.h4
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.cpp2
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.h2
-rw-r--r--examples/widgets/gestures/imagegestures/main.cpp2
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.cpp2
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.h2
-rw-r--r--examples/widgets/graphicsview/chip/chip.h2
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramitem.h4
-rw-r--r--examples/widgets/graphicsview/elasticnodes/graphwidget.cpp2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.cpp2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.h6
-rw-r--r--examples/widgets/graphicsview/flowlayout/flowlayout.h2
-rw-r--r--examples/widgets/graphicsview/flowlayout/window.cpp2
-rw-r--r--examples/widgets/graphicsview/padnavigator/flippablepad.cpp2
-rw-r--r--examples/widgets/graphicsview/padnavigator/flippablepad.h4
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.cpp2
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.cpp2
-rw-r--r--examples/widgets/itemviews/addressbook/tablemodel.cpp7
-rw-r--r--examples/widgets/itemviews/addressbook/tablemodel.h8
-rw-r--r--examples/widgets/itemviews/chart/pieview.cpp5
-rw-r--r--examples/widgets/itemviews/chart/pieview.h2
-rw-r--r--examples/widgets/itemviews/coloreditorfactory/window.cpp7
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treeitem.cpp7
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treeitem.h8
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treemodel.cpp8
-rw-r--r--examples/widgets/itemviews/interview/model.cpp9
-rw-r--r--examples/widgets/itemviews/interview/model.h6
-rw-r--r--examples/widgets/itemviews/puzzle/piecesmodel.h6
-rw-r--r--examples/widgets/itemviews/puzzle/puzzlewidget.h4
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treeitem.cpp2
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treeitem.h8
-rw-r--r--examples/widgets/itemviews/simpletreemodel/treemodel.cpp6
-rw-r--r--examples/widgets/painting/deform/pathdeform.h4
-rw-r--r--examples/widgets/painting/gradients/gradients.cpp2
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.cpp2
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.h4
-rw-r--r--examples/widgets/painting/shared/hoverpoints.h2
-rw-r--r--examples/widgets/richtext/calendar/mainwindow.cpp2
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/highlighter.h2
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp2
-rw-r--r--examples/widgets/tools/undo/document.h2
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.cpp9
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.h6
-rw-r--r--examples/widgets/widgets/tooltips/sortingbox.h2
53 files changed, 101 insertions, 103 deletions
diff --git a/examples/widgets/animation/stickman/animation.cpp b/examples/widgets/animation/stickman/animation.cpp
index 73d79adc84..77a1875be3 100644
--- a/examples/widgets/animation/stickman/animation.cpp
+++ b/examples/widgets/animation/stickman/animation.cpp
@@ -79,7 +79,7 @@ public:
}
private:
- QVector<QPointF> m_nodePositions;
+ QList<QPointF> m_nodePositions;
};
Animation::Animation() : m_currentFrame(0)
diff --git a/examples/widgets/animation/stickman/animation.h b/examples/widgets/animation/stickman/animation.h
index 5cc1133ac0..93caff48a2 100644
--- a/examples/widgets/animation/stickman/animation.h
+++ b/examples/widgets/animation/stickman/animation.h
@@ -53,7 +53,7 @@
#include <QPointF>
#include <QString>
-#include <QVector>
+#include <QList>
class Frame;
QT_BEGIN_NAMESPACE
@@ -85,7 +85,7 @@ public:
private:
QString m_name;
- QVector<Frame *> m_frames;
+ QList<Frame *> m_frames;
int m_currentFrame;
};
diff --git a/examples/widgets/animation/sub-attaq/animationmanager.h b/examples/widgets/animation/sub-attaq/animationmanager.h
index 5ddea66e80..a097e7508e 100644
--- a/examples/widgets/animation/sub-attaq/animationmanager.h
+++ b/examples/widgets/animation/sub-attaq/animationmanager.h
@@ -76,7 +76,7 @@ private slots:
void unregisterAnimation_helper(QObject *obj);
private:
- QVector<QAbstractAnimation *> animations;
+ QList<QAbstractAnimation *> animations;
};
#endif // ANIMATIONMANAGER_H
diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.h b/examples/widgets/animation/sub-attaq/graphicsscene.h
index dd3719bc10..ce9ee115ca 100644
--- a/examples/widgets/animation/sub-attaq/graphicsscene.h
+++ b/examples/widgets/animation/sub-attaq/graphicsscene.h
@@ -85,7 +85,7 @@ public:
struct LevelDescription {
int id = 0;
QString name;
- QVector<QPair<int, int>> submarines;
+ QList<QPair<int, int>> submarines;
};
GraphicsScene(int x, int y, int width, int height, Mode mode, QObject *parent = nullptr);
@@ -114,7 +114,7 @@ private:
QSet<SubMarine *> submarines;
QSet<Bomb *> bombs;
QSet<Torpedo *> torpedos;
- QVector<SubmarineDescription> submarinesData;
+ QList<SubmarineDescription> submarinesData;
QHash<int, LevelDescription> levelsData;
friend class PauseState;
diff --git a/examples/widgets/doc/src/addressbook.qdoc b/examples/widgets/doc/src/addressbook.qdoc
index ed2b8e90e6..22769cb270 100644
--- a/examples/widgets/doc/src/addressbook.qdoc
+++ b/examples/widgets/doc/src/addressbook.qdoc
@@ -90,8 +90,8 @@
\snippet itemviews/addressbook/tablemodel.h 0
Two constructors are used, a default constructor which uses
- \c TableModel's own \c {QVector<Contact>} and one that takes
- \c {QVector<Contact>} as an argument, for convenience.
+ \c TableModel's own \c {QList<Contact>} and one that takes
+ \c {QList<Contact>} as an argument, for convenience.
\section1 TableModel Class Implementation
@@ -161,7 +161,7 @@
them here so that we can reuse the model in other programs.
The last function in \c {TableModel}, \c getContacts() returns the
- QVector<Contact> object that holds all the contacts in the address
+ QList<Contact> object that holds all the contacts in the address
book. We use this function later to obtain the list of contacts to
check for existing entries, write the contacts to a file and read
them back. Further explanation is given with \c AddressWidget.
diff --git a/examples/widgets/doc/src/calendar.qdoc b/examples/widgets/doc/src/calendar.qdoc
index 431815d0c1..4a6a482ff2 100644
--- a/examples/widgets/doc/src/calendar.qdoc
+++ b/examples/widgets/doc/src/calendar.qdoc
@@ -128,7 +128,7 @@
Each cell in the table will be padded and spaced to make the text easier to
read.
- We want the columns to have equal widths, so we provide a vector containing
+ We want the columns to have equal widths, so we provide a list containing
percentage widths for each of them and set the constraints in the
QTextTableFormat:
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 24be09a7a9..16cb0656db 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -260,7 +260,7 @@
QIcon::Active, QIcon::Disabled, QIcon::Selected and the rows in the order
QIcon::Off, QIcon::On, which does not match the enumeration. The above code
provides arrays allowing to map from enumeration value to row/column
- (by using QVector::indexOf()) and back by using the array index and lists
+ (by using QList::indexOf()) and back by using the array index and lists
of the matching strings. Qt's containers can be easily populated by
using C++ 11 initializer lists.
diff --git a/examples/widgets/doc/src/syntaxhighlighter.qdoc b/examples/widgets/doc/src/syntaxhighlighter.qdoc
index 618b387ed5..30dc685843 100644
--- a/examples/widgets/doc/src/syntaxhighlighter.qdoc
+++ b/examples/widgets/doc/src/syntaxhighlighter.qdoc
@@ -66,7 +66,7 @@
We have chosen to store our highlighting rules using a private
struct: A rule consists of a QRegularExpression pattern and a
QTextCharFormat instance. The various rules are then stored using a
- QVector.
+ QList.
The QTextCharFormat class provides formatting information for
characters in a QTextDocument specifying the visual properties of
@@ -137,7 +137,7 @@
blocks that have changed.
First we apply the syntax highlighting rules that we stored in the
- \c highlightingRules vector. For each rule (i.e. for each
+ \c highlightingRules list. For each rule (i.e. for each
HighlightingRule object) we search for the pattern in the given
text block using the QString::indexOf() function. When the first
occurrence of the pattern is found, we use the
diff --git a/examples/widgets/doc/src/tooltips.qdoc b/examples/widgets/doc/src/tooltips.qdoc
index 35e3b1e29f..a278215503 100644
--- a/examples/widgets/doc/src/tooltips.qdoc
+++ b/examples/widgets/doc/src/tooltips.qdoc
@@ -95,7 +95,7 @@
\snippet widgets/tooltips/sortingbox.h 2
- We keep all the shape items in a QVector, and we keep three
+ We keep all the shape items in a QList, and we keep three
QPainterPath objects holding the shapes of a circle, a square and
a triangle. We also need to have a pointer to an item when it is
moving, and we need to know its previous position.
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.h b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
index 40dd654af6..0ac4719d74 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h
@@ -53,7 +53,7 @@
#include <QPoint>
#include <QPixmap>
-#include <QVector>
+#include <QList>
#include <QWidget>
QT_BEGIN_NAMESPACE
@@ -94,7 +94,7 @@ private:
int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
- QVector<Piece> pieces;
+ QList<Piece> pieces;
QRect highlightedRect;
int inPlace;
int m_ImageSize;
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.cpp b/examples/widgets/gestures/imagegestures/imagewidget.cpp
index fb5351f949..072ec2b216 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.cpp
+++ b/examples/widgets/gestures/imagegestures/imagewidget.cpp
@@ -66,7 +66,7 @@ ImageWidget::ImageWidget(QWidget *parent)
}
//! [constructor]
-void ImageWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
+void ImageWidget::grabGestures(const QList<Qt::GestureType> &gestures)
{
//! [enable gestures]
for (Qt::GestureType gesture : gestures)
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h
index ae5eb7bc2b..f9b5d989e9 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.h
+++ b/examples/widgets/gestures/imagegestures/imagewidget.h
@@ -72,7 +72,7 @@ class ImageWidget : public QWidget
public:
ImageWidget(QWidget *parent = nullptr);
void openDirectory(const QString &path);
- void grabGestures(const QVector<Qt::GestureType> &gestures);
+ void grabGestures(const QList<Qt::GestureType> &gestures);
protected:
bool event(QEvent *event) override;
diff --git a/examples/widgets/gestures/imagegestures/main.cpp b/examples/widgets/gestures/imagegestures/main.cpp
index 4f8d4ec15e..ecd7462bd3 100644
--- a/examples/widgets/gestures/imagegestures/main.cpp
+++ b/examples/widgets/gestures/imagegestures/main.cpp
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
return -1;
}
- QVector<Qt::GestureType> gestures;
+ QList<Qt::GestureType> gestures;
if (!commandLineParser.isSet(disablePanOption))
gestures << Qt::PanGesture;
if (!commandLineParser.isSet(disablePinchOption))
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.cpp b/examples/widgets/gestures/imagegestures/mainwidget.cpp
index d1c786a93a..c4e63e9e7d 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.cpp
+++ b/examples/widgets/gestures/imagegestures/mainwidget.cpp
@@ -72,7 +72,7 @@ void MainWidget::openDirectory(const QString &path)
imageWidget->openDirectory(path);
}
-void MainWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
+void MainWidget::grabGestures(const QList<Qt::GestureType> &gestures)
{
imageWidget->grabGestures(gestures);
}
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h
index 1600597251..794f052f3c 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.h
+++ b/examples/widgets/gestures/imagegestures/mainwidget.h
@@ -61,7 +61,7 @@ class MainWidget : public QMainWindow
public:
MainWidget(QWidget *parent = nullptr);
- void grabGestures(const QVector<Qt::GestureType> &gestures);
+ void grabGestures(const QList<Qt::GestureType> &gestures);
public slots:
void openDirectory(const QString &path);
diff --git a/examples/widgets/graphicsview/chip/chip.h b/examples/widgets/graphicsview/chip/chip.h
index f3d54e6295..6c36ccb6d3 100644
--- a/examples/widgets/graphicsview/chip/chip.h
+++ b/examples/widgets/graphicsview/chip/chip.h
@@ -72,7 +72,7 @@ private:
int x;
int y;
QColor color;
- QVector<QPointF> stuff;
+ QList<QPointF> stuff;
};
#endif // CHIP_H
diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.h b/examples/widgets/graphicsview/diagramscene/diagramitem.h
index ffaea4b7a8..0fc286b2a8 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramitem.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramitem.h
@@ -52,7 +52,7 @@
#define DIAGRAMITEM_H
#include <QGraphicsPixmapItem>
-#include <QVector>
+#include <QList>
QT_BEGIN_NAMESPACE
class QPixmap;
@@ -88,7 +88,7 @@ private:
DiagramType myDiagramType;
QPolygonF myPolygon;
QMenu *myContextMenu;
- QVector<Arrow *> arrows;
+ QList<Arrow *> arrows;
};
//! [0]
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
index a067f82ad7..51e179a464 100644
--- a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
@@ -163,7 +163,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
- QVector<Node *> nodes;
+ QList<Node *> nodes;
const QList<QGraphicsItem *> items = scene()->items();
for (QGraphicsItem *item : items) {
if (Node *node = qgraphicsitem_cast<Node *>(item))
diff --git a/examples/widgets/graphicsview/elasticnodes/node.cpp b/examples/widgets/graphicsview/elasticnodes/node.cpp
index a67e21c4b3..8d44a167fa 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/node.cpp
@@ -75,7 +75,7 @@ void Node::addEdge(Edge *edge)
edge->adjust();
}
-QVector<Edge *> Node::edges() const
+QList<Edge *> Node::edges() const
{
return edgeList;
}
diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h
index b160ff37cc..5ccc52595c 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.h
+++ b/examples/widgets/graphicsview/elasticnodes/node.h
@@ -52,7 +52,7 @@
#define NODE_H
#include <QGraphicsItem>
-#include <QVector>
+#include <QList>
class Edge;
class GraphWidget;
@@ -64,7 +64,7 @@ public:
Node(GraphWidget *graphWidget);
void addEdge(Edge *edge);
- QVector<Edge *> edges() const;
+ QList<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const override { return Type; }
@@ -83,7 +83,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
- QVector<Edge *> edgeList;
+ QList<Edge *> edgeList;
QPointF newPos;
GraphWidget *graph;
};
diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.h b/examples/widgets/graphicsview/flowlayout/flowlayout.h
index c6758414d6..14251072ec 100644
--- a/examples/widgets/graphicsview/flowlayout/flowlayout.h
+++ b/examples/widgets/graphicsview/flowlayout/flowlayout.h
@@ -75,7 +75,7 @@ private:
QSizeF prefSize() const;
QSizeF maxSize() const;
- QVector<QGraphicsLayoutItem*> m_items;
+ QList<QGraphicsLayoutItem *> m_items;
qreal m_spacing[2] = {6, 6};
};
diff --git a/examples/widgets/graphicsview/flowlayout/window.cpp b/examples/widgets/graphicsview/flowlayout/window.cpp
index 0edaa686b4..dd4e3661da 100644
--- a/examples/widgets/graphicsview/flowlayout/window.cpp
+++ b/examples/widgets/graphicsview/flowlayout/window.cpp
@@ -59,7 +59,7 @@ Window::Window(QGraphicsItem *parent) : QGraphicsWidget(parent, Qt::Window)
FlowLayout *lay = new FlowLayout;
const QString sentence(QLatin1String("I am not bothered by the fact that I am unknown."
" I am bothered when I do not know others. (Confucius)"));
- const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
+ const QList<QStringRef> words = sentence.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
for (const QStringRef &word : words) {
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
QLabel *label = new QLabel(word.toString());
diff --git a/examples/widgets/graphicsview/padnavigator/flippablepad.cpp b/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
index 6a9097a736..263909225e 100644
--- a/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
+++ b/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
@@ -75,7 +75,7 @@ FlippablePad::FlippablePad(const QSize &size, QGraphicsItem *parent)
//! [2]
//! [3]
int numIcons = size.width() * size.height();
- QVector<QPixmap> pixmaps;
+ QList<QPixmap> pixmaps;
QDirIterator it(":/images", {"*.png"});
while (it.hasNext() && pixmaps.size() < numIcons)
pixmaps << it.next();
diff --git a/examples/widgets/graphicsview/padnavigator/flippablepad.h b/examples/widgets/graphicsview/padnavigator/flippablepad.h
index ef757c47fb..a056eae1c5 100644
--- a/examples/widgets/graphicsview/padnavigator/flippablepad.h
+++ b/examples/widgets/graphicsview/padnavigator/flippablepad.h
@@ -53,7 +53,7 @@
#include "roundrectitem.h"
-#include <QVector>
+#include <QList>
//! [0]
class FlippablePad : public RoundRectItem
@@ -64,7 +64,7 @@ public:
RoundRectItem *iconAt(int column, int row) const;
private:
- QVector<QVector<RoundRectItem *> > iconGrid;
+ QList<QList<RoundRectItem *>> iconGrid;
};
//! [0]
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.cpp b/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
index dbf89dd318..5088386a26 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
@@ -228,7 +228,7 @@ PadNavigator::PadNavigator(const QSize &size, QWidget *parent)
// Create substates for each icon; store in temporary grid.
int columns = size.width();
int rows = size.height();
- QVector< QVector< QState * > > stateGrid;
+ QList<QList<QState *>> stateGrid;
stateGrid.resize(rows);
for (int y = 0; y < rows; ++y) {
stateGrid[y].resize(columns);
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.cpp b/examples/widgets/itemviews/addressbook/addresswidget.cpp
index b1b65174ee..25706d1abe 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.cpp
+++ b/examples/widgets/itemviews/addressbook/addresswidget.cpp
@@ -201,7 +201,7 @@ void AddressWidget::readFromFile(const QString &fileName)
return;
}
- QVector<Contact> contacts;
+ QList<Contact> contacts;
QDataStream in(&file);
in >> contacts;
diff --git a/examples/widgets/itemviews/addressbook/tablemodel.cpp b/examples/widgets/itemviews/addressbook/tablemodel.cpp
index ddf79a3fa3..aac4c92060 100644
--- a/examples/widgets/itemviews/addressbook/tablemodel.cpp
+++ b/examples/widgets/itemviews/addressbook/tablemodel.cpp
@@ -56,9 +56,8 @@ TableModel::TableModel(QObject *parent)
{
}
-TableModel::TableModel(const QVector<Contact> &contacts, QObject *parent)
- : QAbstractTableModel(parent),
- contacts(contacts)
+TableModel::TableModel(const QList<Contact> &contacts, QObject *parent)
+ : QAbstractTableModel(parent), contacts(contacts)
{
}
//! [0]
@@ -186,7 +185,7 @@ Qt::ItemFlags TableModel::flags(const QModelIndex &index) const
//! [7]
//! [8]
-const QVector<Contact> &TableModel::getContacts() const
+const QList<Contact> &TableModel::getContacts() const
{
return contacts;
}
diff --git a/examples/widgets/itemviews/addressbook/tablemodel.h b/examples/widgets/itemviews/addressbook/tablemodel.h
index e4025fc734..c5bac4f4a4 100644
--- a/examples/widgets/itemviews/addressbook/tablemodel.h
+++ b/examples/widgets/itemviews/addressbook/tablemodel.h
@@ -52,7 +52,7 @@
#define TABLEMODEL_H
#include <QAbstractTableModel>
-#include <QVector>
+#include <QList>
//! [0]
@@ -83,7 +83,7 @@ class TableModel : public QAbstractTableModel
public:
TableModel(QObject *parent = nullptr);
- TableModel(const QVector<Contact> &contacts, QObject *parent = nullptr);
+ TableModel(const QList<Contact> &contacts, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
@@ -93,10 +93,10 @@ public:
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
- const QVector<Contact> &getContacts() const;
+ const QList<Contact> &getContacts() const;
private:
- QVector<Contact> contacts;
+ QList<Contact> contacts;
};
//! [0]
diff --git a/examples/widgets/itemviews/chart/pieview.cpp b/examples/widgets/itemviews/chart/pieview.cpp
index c640c78f3e..af77970633 100644
--- a/examples/widgets/itemviews/chart/pieview.cpp
+++ b/examples/widgets/itemviews/chart/pieview.cpp
@@ -59,9 +59,8 @@ PieView::PieView(QWidget *parent)
verticalScrollBar()->setRange(0, 0);
}
-void PieView::dataChanged(const QModelIndex &topLeft,
- const QModelIndex &bottomRight,
- const QVector<int> &roles)
+void PieView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
+ const QList<int> &roles)
{
QAbstractItemView::dataChanged(topLeft, bottomRight, roles);
diff --git a/examples/widgets/itemviews/chart/pieview.h b/examples/widgets/itemviews/chart/pieview.h
index 22c74dde81..f92a443463 100644
--- a/examples/widgets/itemviews/chart/pieview.h
+++ b/examples/widgets/itemviews/chart/pieview.h
@@ -67,7 +67,7 @@ public:
protected slots:
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight,
- const QVector<int> &roles = QVector<int>()) override;
+ const QList<int> &roles = QList<int>()) override;
void rowsInserted(const QModelIndex &parent, int start, int end) override;
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override;
diff --git a/examples/widgets/itemviews/coloreditorfactory/window.cpp b/examples/widgets/itemviews/coloreditorfactory/window.cpp
index 25e196a80c..fde82accfd 100644
--- a/examples/widgets/itemviews/coloreditorfactory/window.cpp
+++ b/examples/widgets/itemviews/coloreditorfactory/window.cpp
@@ -71,10 +71,9 @@ Window::Window()
void Window::createGUI()
{
- const QVector<QPair<QString, QColor> > list =
- {{ tr("Alice"), QColor("aliceblue") },
- { tr("Neptun"), QColor("aquamarine") },
- { tr("Ferdinand"), QColor("springgreen") }};
+ const QList<QPair<QString, QColor>> list = { { tr("Alice"), QColor("aliceblue") },
+ { tr("Neptun"), QColor("aquamarine") },
+ { tr("Ferdinand"), QColor("springgreen") } };
QTableWidget *table = new QTableWidget(3, 2);
table->setHorizontalHeaderLabels({ tr("Name"), tr("Hair Color") });
diff --git a/examples/widgets/itemviews/editabletreemodel/treeitem.cpp b/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
index 027a5f8849..e82c84a424 100644
--- a/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
@@ -57,9 +57,8 @@
#include "treeitem.h"
//! [0]
-TreeItem::TreeItem(const QVector<QVariant> &data, TreeItem *parent)
- : itemData(data),
- parentItem(parent)
+TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent)
+ : itemData(data), parentItem(parent)
{}
//! [0]
@@ -118,7 +117,7 @@ bool TreeItem::insertChildren(int position, int count, int columns)
return false;
for (int row = 0; row < count; ++row) {
- QVector<QVariant> data(columns);
+ QList<QVariant> data(columns);
TreeItem *item = new TreeItem(data, this);
childItems.insert(position, item);
}
diff --git a/examples/widgets/itemviews/editabletreemodel/treeitem.h b/examples/widgets/itemviews/editabletreemodel/treeitem.h
index 867be5f380..b23697efe3 100644
--- a/examples/widgets/itemviews/editabletreemodel/treeitem.h
+++ b/examples/widgets/itemviews/editabletreemodel/treeitem.h
@@ -52,13 +52,13 @@
#define TREEITEM_H
#include <QVariant>
-#include <QVector>
+#include <QList>
//! [0]
class TreeItem
{
public:
- explicit TreeItem(const QVector<QVariant> &data, TreeItem *parent = nullptr);
+ explicit TreeItem(const QList<QVariant> &data, TreeItem *parent = nullptr);
~TreeItem();
TreeItem *child(int number);
@@ -74,8 +74,8 @@ public:
bool setData(int column, const QVariant &value);
private:
- QVector<TreeItem*> childItems;
- QVector<QVariant> itemData;
+ QList<TreeItem *> childItems;
+ QList<QVariant> itemData;
TreeItem *parentItem;
};
//! [0]
diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
index 9678e45be7..1161a8b5d2 100644
--- a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp
@@ -57,7 +57,7 @@
TreeModel::TreeModel(const QStringList &headers, const QString &data, QObject *parent)
: QAbstractItemModel(parent)
{
- QVector<QVariant> rootData;
+ QList<QVariant> rootData;
for (const QString &header : headers)
rootData << header;
@@ -248,8 +248,8 @@ bool TreeModel::setHeaderData(int section, Qt::Orientation orientation,
void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
{
- QVector<TreeItem*> parents;
- QVector<int> indentations;
+ QList<TreeItem *> parents;
+ QList<int> indentations;
parents << parent;
indentations << 0;
@@ -269,7 +269,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
// Read the column data from the rest of the line.
const QStringList columnStrings =
lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
- QVector<QVariant> columnData;
+ QList<QVariant> columnData;
columnData.reserve(columnStrings.size());
for (const QString &columnString : columnStrings)
columnData << columnString;
diff --git a/examples/widgets/itemviews/interview/model.cpp b/examples/widgets/itemviews/interview/model.cpp
index 519164999d..5422757d95 100644
--- a/examples/widgets/itemviews/interview/model.cpp
+++ b/examples/widgets/itemviews/interview/model.cpp
@@ -55,8 +55,9 @@
Model::Model(int rows, int columns, QObject *parent)
: QAbstractItemModel(parent),
services(QPixmap(":/images/services.png")),
- rc(rows), cc(columns),
- tree(new QVector<Node>(rows, Node()))
+ rc(rows),
+ cc(columns),
+ tree(new QList<Node>(rows, Node()))
{
}
@@ -139,8 +140,8 @@ Qt::ItemFlags Model::flags(const QModelIndex &index) const
Model::Node *Model::node(int row, Node *parent) const
{
if (parent && !parent->children)
- parent->children = new QVector<Node>(rc, Node(parent));
- QVector<Node> *v = parent ? parent->children : tree;
+ parent->children = new QList<Node>(rc, Node(parent));
+ QList<Node> *v = parent ? parent->children : tree;
return const_cast<Node*>(&(v->at(row)));
}
diff --git a/examples/widgets/itemviews/interview/model.h b/examples/widgets/itemviews/interview/model.h
index 132f1d01aa..ee64a32f93 100644
--- a/examples/widgets/itemviews/interview/model.h
+++ b/examples/widgets/itemviews/interview/model.h
@@ -54,7 +54,7 @@
#include <QAbstractItemModel>
#include <QFileIconProvider>
#include <QIcon>
-#include <QVector>
+#include <QList>
class Model : public QAbstractItemModel
{
@@ -83,7 +83,7 @@ private:
Node(Node *parent = nullptr) : parent(parent), children(nullptr) {}
~Node() { delete children; }
Node *parent;
- QVector<Node> *children;
+ QList<Node> *children;
};
Node *node(int row, Node *parent) const;
@@ -93,7 +93,7 @@ private:
QIcon services;
int rc;
int cc;
- QVector<Node> *tree;
+ QList<Node> *tree;
QFileIconProvider iconProvider;
};
diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.h b/examples/widgets/itemviews/puzzle/piecesmodel.h
index 2a96603707..99cd7677b5 100644
--- a/examples/widgets/itemviews/puzzle/piecesmodel.h
+++ b/examples/widgets/itemviews/puzzle/piecesmodel.h
@@ -55,7 +55,7 @@
#include <QPixmap>
#include <QPoint>
#include <QStringList>
-#include <QVector>
+#include <QList>
QT_BEGIN_NAMESPACE
class QMimeData;
@@ -83,8 +83,8 @@ public:
void addPieces(const QPixmap &pixmap);
private:
- QVector<QPoint> locations;
- QVector<QPixmap> pixmaps;
+ QList<QPoint> locations;
+ QList<QPixmap> pixmaps;
int m_PieceSize;
};
diff --git a/examples/widgets/itemviews/puzzle/puzzlewidget.h b/examples/widgets/itemviews/puzzle/puzzlewidget.h
index 40dd654af6..0ac4719d74 100644
--- a/examples/widgets/itemviews/puzzle/puzzlewidget.h
+++ b/examples/widgets/itemviews/puzzle/puzzlewidget.h
@@ -53,7 +53,7 @@
#include <QPoint>
#include <QPixmap>
-#include <QVector>
+#include <QList>
#include <QWidget>
QT_BEGIN_NAMESPACE
@@ -94,7 +94,7 @@ private:
int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
- QVector<Piece> pieces;
+ QList<Piece> pieces;
QRect highlightedRect;
int inPlace;
int m_ImageSize;
diff --git a/examples/widgets/itemviews/simpletreemodel/treeitem.cpp b/examples/widgets/itemviews/simpletreemodel/treeitem.cpp
index 41fe24e737..f998432252 100644
--- a/examples/widgets/itemviews/simpletreemodel/treeitem.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treeitem.cpp
@@ -57,7 +57,7 @@
#include "treeitem.h"
//! [0]
-TreeItem::TreeItem(const QVector<QVariant> &data, TreeItem *parent)
+TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent)
: m_itemData(data), m_parentItem(parent)
{}
//! [0]
diff --git a/examples/widgets/itemviews/simpletreemodel/treeitem.h b/examples/widgets/itemviews/simpletreemodel/treeitem.h
index 390433597d..10c5dda35c 100644
--- a/examples/widgets/itemviews/simpletreemodel/treeitem.h
+++ b/examples/widgets/itemviews/simpletreemodel/treeitem.h
@@ -52,13 +52,13 @@
#define TREEITEM_H
#include <QVariant>
-#include <QVector>
+#include <QList>
//! [0]
class TreeItem
{
public:
- explicit TreeItem(const QVector<QVariant> &data, TreeItem *parentItem = nullptr);
+ explicit TreeItem(const QList<QVariant> &data, TreeItem *parentItem = nullptr);
~TreeItem();
void appendChild(TreeItem *child);
@@ -71,8 +71,8 @@ public:
TreeItem *parentItem();
private:
- QVector<TreeItem*> m_childItems;
- QVector<QVariant> m_itemData;
+ QList<TreeItem *> m_childItems;
+ QList<QVariant> m_itemData;
TreeItem *m_parentItem;
};
//! [0]
diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
index 28640d6433..d94fdb08cd 100644
--- a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
+++ b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp
@@ -175,8 +175,8 @@ int TreeModel::rowCount(const QModelIndex &parent) const
void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
{
- QVector<TreeItem*> parents;
- QVector<int> indentations;
+ QList<TreeItem *> parents;
+ QList<int> indentations;
parents << parent;
indentations << 0;
@@ -196,7 +196,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
// Read the column data from the rest of the line.
const QStringList columnStrings =
lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
- QVector<QVariant> columnData;
+ QList<QVariant> columnData;
columnData.reserve(columnStrings.count());
for (const QString &columnString : columnStrings)
columnData << columnString;
diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h
index af869badc9..0314755b34 100644
--- a/examples/widgets/painting/deform/pathdeform.h
+++ b/examples/widgets/painting/deform/pathdeform.h
@@ -105,8 +105,8 @@ private:
// int m_fpsCounter;
QElapsedTimer m_repaintTracker;
- QVector<QPainterPath> m_paths;
- QVector<QPointF> m_advances;
+ QList<QPainterPath> m_paths;
+ QList<QPointF> m_advances;
QRectF m_pathBounds;
QString m_text;
diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp
index cb1a0177e9..76d5818d32 100644
--- a/examples/widgets/painting/gradients/gradients.cpp
+++ b/examples/widgets/painting/gradients/gradients.cpp
@@ -542,7 +542,7 @@ GradientRenderer::GradientRenderer(QWidget *parent)
m_hoverPoints->setConnectionType(HoverPoints::NoConnection);
m_hoverPoints->setEditable(false);
- QVector<QPointF> points;
+ QList<QPointF> points;
points << QPointF(100, 100) << QPointF(200, 200);
m_hoverPoints->setPoints(points);
diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp
index 439bcb2cd0..412c2da6a4 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.cpp
+++ b/examples/widgets/painting/pathstroke/pathstroke.cpp
@@ -470,7 +470,7 @@ void PathStrokeRenderer::paint(QPainter *painter)
stroker.setJoinStyle(m_joinStyle);
stroker.setCapStyle(m_capStyle);
- QVector<qreal> dashes;
+ QList<qreal> dashes;
qreal space = 4;
dashes << 1 << space
<< 3 << space
diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h
index b559ed2ba0..e7e78b641b 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.h
+++ b/examples/widgets/painting/pathstroke/pathstroke.h
@@ -119,8 +119,8 @@ private:
int m_pointCount;
int m_pointSize;
int m_activePoint;
- QVector<QPointF> m_points;
- QVector<QPointF> m_vectors;
+ QList<QPointF> m_points;
+ QList<QPointF> m_vectors;
Qt::PenJoinStyle m_joinStyle;
Qt::PenCapStyle m_capStyle;
diff --git a/examples/widgets/painting/shared/hoverpoints.h b/examples/widgets/painting/shared/hoverpoints.h
index 6bf1cafe4e..3c6f356e1b 100644
--- a/examples/widgets/painting/shared/hoverpoints.h
+++ b/examples/widgets/painting/shared/hoverpoints.h
@@ -135,7 +135,7 @@ private:
SortType m_sortType;
ConnectionType m_connectionType;
- QVector<uint> m_locks;
+ QList<uint> m_locks;
QSizeF m_pointSize;
int m_currentIndex;
diff --git a/examples/widgets/richtext/calendar/mainwindow.cpp b/examples/widgets/richtext/calendar/mainwindow.cpp
index 8ac5a8cdce..2b8fd518af 100644
--- a/examples/widgets/richtext/calendar/mainwindow.cpp
+++ b/examples/widgets/richtext/calendar/mainwindow.cpp
@@ -132,7 +132,7 @@ void MainWindow::insertCalendar()
tableFormat.setCellPadding(2);
tableFormat.setCellSpacing(4);
//! [6] //! [7]
- QVector<QTextLength> constraints;
+ QList<QTextLength> constraints;
constraints << QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
diff --git a/examples/widgets/richtext/syntaxhighlighter/highlighter.h b/examples/widgets/richtext/syntaxhighlighter/highlighter.h
index 0a24224b56..163b01cda6 100644
--- a/examples/widgets/richtext/syntaxhighlighter/highlighter.h
+++ b/examples/widgets/richtext/syntaxhighlighter/highlighter.h
@@ -76,7 +76,7 @@ private:
QRegularExpression pattern;
QTextCharFormat format;
};
- QVector<HighlightingRule> highlightingRules;
+ QList<HighlightingRule> highlightingRules;
QRegularExpression commentStartExpression;
QRegularExpression commentEndExpression;
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index 3305ac9032..44c5b1312a 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -201,7 +201,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
#endif
QStandardItemModel *model = new QStandardItemModel(completer);
- QVector<QStandardItem *> parents(10);
+ QList<QStandardItem *> parents(10);
parents[0] = model->invisibleRootItem();
QRegularExpression re("^\\s+");
diff --git a/examples/widgets/tools/undo/document.h b/examples/widgets/tools/undo/document.h
index 01447ef541..6e728ca7a9 100644
--- a/examples/widgets/tools/undo/document.h
+++ b/examples/widgets/tools/undo/document.h
@@ -121,7 +121,7 @@ private:
int indexAt(const QPoint &pos) const;
QString uniqueName(const QString &name) const;
- QVector<Shape> m_shapeList;
+ QList<Shape> m_shapeList;
QPoint m_mousePressOffset;
QString m_fileName;
QUndoStack *m_undoStack = nullptr;
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.cpp b/examples/widgets/widgets/icons/iconpreviewarea.cpp
index 96cb6f008e..8a1ef8a3c4 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.cpp
+++ b/examples/widgets/widgets/icons/iconpreviewarea.cpp
@@ -81,15 +81,16 @@ IconPreviewArea::IconPreviewArea(QWidget *parent)
//! [0]
//! [42]
-QVector<QIcon::Mode> IconPreviewArea::iconModes()
+QList<QIcon::Mode> IconPreviewArea::iconModes()
{
- static const QVector<QIcon::Mode> result = {QIcon::Normal, QIcon::Active, QIcon::Disabled, QIcon::Selected};
+ static const QList<QIcon::Mode> result = { QIcon::Normal, QIcon::Active, QIcon::Disabled,
+ QIcon::Selected };
return result;
}
-QVector<QIcon::State> IconPreviewArea::iconStates()
+QList<QIcon::State> IconPreviewArea::iconStates()
{
- static const QVector<QIcon::State> result = {QIcon::Off, QIcon::On};
+ static const QList<QIcon::State> result = { QIcon::Off, QIcon::On };
return result;
}
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.h b/examples/widgets/widgets/icons/iconpreviewarea.h
index 6ea35a5230..5387cb9f6d 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.h
+++ b/examples/widgets/widgets/icons/iconpreviewarea.h
@@ -54,7 +54,7 @@
#include <QIcon>
#include <QWidget>
#include <QStringList>
-#include <QVector>
+#include <QList>
QT_BEGIN_NAMESPACE
class QLabel;
@@ -71,8 +71,8 @@ public:
void setIcon(const QIcon &icon);
void setSize(const QSize &size);
- static QVector<QIcon::Mode> iconModes();
- static QVector<QIcon::State> iconStates();
+ static QList<QIcon::Mode> iconModes();
+ static QList<QIcon::State> iconStates();
static QStringList iconModeNames();
static QStringList iconStateNames();
diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h
index 785154746e..3d0cecea2b 100644
--- a/examples/widgets/widgets/tooltips/sortingbox.h
+++ b/examples/widgets/widgets/tooltips/sortingbox.h
@@ -99,7 +99,7 @@ private:
const char *member);
//! [2]
- QVector<ShapeItem> shapeItems;
+ QList<ShapeItem> shapeItems;
QPainterPath circlePath;
QPainterPath squarePath;
QPainterPath trianglePath;