summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview
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/graphicsview
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/graphicsview')
-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
10 files changed, 14 insertions, 14 deletions
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);