summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-24 15:27:07 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-26 05:10:39 +0200
commitd765f71f3cf59a2eda1dca5215dda62b630cb202 (patch)
tree6dee5fbbd4906d76b71a415c8dcb5b97a481a254 /examples
parent96a69e7d368a77f52f647fd71c978f418c6b5bac (diff)
Use QList instead of QVector
Task-number: QTBUG-84469 Change-Id: Ibaf2524e49e75ec660889261347eddbae9ccdbc6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/scxml/sudoku/doc/src/sudoku.qdoc10
-rw-r--r--examples/scxml/sudoku/mainwindow.cpp4
-rw-r--r--examples/scxml/sudoku/mainwindow.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/examples/scxml/sudoku/doc/src/sudoku.qdoc b/examples/scxml/sudoku/doc/src/sudoku.qdoc
index c3d8971..c9a27e3 100644
--- a/examples/scxml/sudoku/doc/src/sudoku.qdoc
+++ b/examples/scxml/sudoku/doc/src/sudoku.qdoc
@@ -106,10 +106,10 @@
remains unchanged.
\row
\li \c undoStack
- \li Holds the history of players' moves. It is a vector of
+ \li Holds the history of players' moves. It is a list of
the cells' coordinates that were touched last. Each
new modification during a game adds a pair of
- x and y coordinates to that vector.
+ x and y coordinates to that list.
\endtable
The variables above are shared with the script helper functions
@@ -257,12 +257,12 @@
grid is properly solved. Since we need to check
each row, each column, and each 3x3 square, we define
the \c isOK() helper function. This function takes
- the vector of numbers and returns \c true if the passed vector
+ the list of numbers and returns \c true if the passed list
contains unique numbers and no number equals zero, meaning
there is no empty cell. The main loop of the \c isSolved() is invoked
- nine times. In every iteration, we construct three vectors of numbers
+ nine times. In every iteration, we construct three lists of numbers
representing a row, a column, and a square of the grid and call \c isOK()
- for them. When all 27 vectors are OK, the grid is solved properly
+ for them. When all 27 lists are OK, the grid is solved properly
and we return \c true.
Coming back to our SCXML file, in case \c isSolved()
diff --git a/examples/scxml/sudoku/mainwindow.cpp b/examples/scxml/sudoku/mainwindow.cpp
index 8b521ae..21f4335 100644
--- a/examples/scxml/sudoku/mainwindow.cpp
+++ b/examples/scxml/sudoku/mainwindow.cpp
@@ -106,8 +106,8 @@ MainWindow::MainWindow(QScxmlStateMachine *machine, QWidget *parent) :
QWidget(parent),
m_machine(machine)
{
- const QVector<QToolButton *> initVector(Size, nullptr);
- m_buttons = QVector<QVector<QToolButton *> >(Size, initVector);
+ const QList<QToolButton *> initVector(Size, nullptr);
+ m_buttons = QList<QList<QToolButton *>>(Size, initVector);
QGridLayout *layout = new QGridLayout(this);
diff --git a/examples/scxml/sudoku/mainwindow.h b/examples/scxml/sudoku/mainwindow.h
index b37279e..96fec27 100644
--- a/examples/scxml/sudoku/mainwindow.h
+++ b/examples/scxml/sudoku/mainwindow.h
@@ -71,7 +71,7 @@ public:
private:
QScxmlStateMachine *m_machine;
- QVector<QVector<QToolButton *> > m_buttons;
+ QList<QList<QToolButton *>> m_buttons;
QToolButton *m_startButton;
QToolButton *m_undoButton;
QLabel *m_label;