summaryrefslogtreecommitdiff
path: root/examples/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'examples/corelib')
-rw-r--r--examples/corelib/serialization/convert/converter.h4
-rw-r--r--examples/corelib/serialization/convert/main.cpp4
-rw-r--r--examples/corelib/serialization/savegame/doc/src/savegame.qdoc2
-rw-r--r--examples/corelib/serialization/savegame/game.cpp6
-rw-r--r--examples/corelib/serialization/savegame/game.h6
-rw-r--r--examples/corelib/serialization/savegame/level.cpp4
-rw-r--r--examples/corelib/serialization/savegame/level.h8
-rw-r--r--examples/corelib/tools/customtype/message.cpp2
8 files changed, 18 insertions, 18 deletions
diff --git a/examples/corelib/serialization/convert/converter.h b/examples/corelib/serialization/convert/converter.h
index 82e1fa1cb3..56b501a076 100644
--- a/examples/corelib/serialization/convert/converter.h
+++ b/examples/corelib/serialization/convert/converter.h
@@ -54,9 +54,9 @@
#include <QIODevice>
#include <QPair>
#include <QVariant>
-#include <QVector>
+#include <QList>
-class VariantOrderedMap : public QVector<QPair<QVariant, QVariant>>
+class VariantOrderedMap : public QList<QPair<QVariant, QVariant>>
{
public:
VariantOrderedMap() = default;
diff --git a/examples/corelib/serialization/convert/main.cpp b/examples/corelib/serialization/convert/main.cpp
index e9d14792b0..161fec6bcd 100644
--- a/examples/corelib/serialization/convert/main.cpp
+++ b/examples/corelib/serialization/convert/main.cpp
@@ -58,12 +58,12 @@
#include <stdio.h>
-static QVector<Converter *> *availableConverters;
+static QList<Converter *> *availableConverters;
Converter::Converter()
{
if (!availableConverters)
- availableConverters = new QVector<Converter *>;
+ availableConverters = new QList<Converter *>;
availableConverters->append(this);
}
diff --git a/examples/corelib/serialization/savegame/doc/src/savegame.qdoc b/examples/corelib/serialization/savegame/doc/src/savegame.qdoc
index e20cb6bc6c..7f138ff110 100644
--- a/examples/corelib/serialization/savegame/doc/src/savegame.qdoc
+++ b/examples/corelib/serialization/savegame/doc/src/savegame.qdoc
@@ -77,7 +77,7 @@
\snippet serialization/savegame/level.h 0
We want to have several levels in our game, each with several NPCs, so we
- keep a QVector of Character objects. We also provide the familiar read() and
+ keep a QList of Character objects. We also provide the familiar read() and
write() functions.
\snippet serialization/savegame/level.cpp 0
diff --git a/examples/corelib/serialization/savegame/game.cpp b/examples/corelib/serialization/savegame/game.cpp
index 58fc087b1f..bb7c2013f2 100644
--- a/examples/corelib/serialization/savegame/game.cpp
+++ b/examples/corelib/serialization/savegame/game.cpp
@@ -63,7 +63,7 @@ Character Game::player() const
return mPlayer;
}
-QVector<Level> Game::levels() const
+QList<Level> Game::levels() const
{
return mLevels;
}
@@ -80,7 +80,7 @@ void Game::newGame()
mLevels.reserve(2);
Level village(QStringLiteral("Village"));
- QVector<Character> villageNpcs;
+ QList<Character> villageNpcs;
villageNpcs.reserve(2);
villageNpcs.append(Character(QStringLiteral("Barry the Blacksmith"),
QRandomGenerator::global()->bounded(8, 11),
@@ -92,7 +92,7 @@ void Game::newGame()
mLevels.append(village);
Level dungeon(QStringLiteral("Dungeon"));
- QVector<Character> dungeonNpcs;
+ QList<Character> dungeonNpcs;
dungeonNpcs.reserve(3);
dungeonNpcs.append(Character(QStringLiteral("Eric the Evil"),
QRandomGenerator::global()->bounded(18, 26),
diff --git a/examples/corelib/serialization/savegame/game.h b/examples/corelib/serialization/savegame/game.h
index 3da9c148be..dfcb27eb1c 100644
--- a/examples/corelib/serialization/savegame/game.h
+++ b/examples/corelib/serialization/savegame/game.h
@@ -52,7 +52,7 @@
#define GAME_H
#include <QJsonObject>
-#include <QVector>
+#include <QList>
#include "character.h"
#include "level.h"
@@ -66,7 +66,7 @@ public:
};
Character player() const;
- QVector<Level> levels() const;
+ QList<Level> levels() const;
void newGame();
bool loadGame(SaveFormat saveFormat);
@@ -78,7 +78,7 @@ public:
void print(int indentation = 0) const;
private:
Character mPlayer;
- QVector<Level> mLevels;
+ QList<Level> mLevels;
};
//! [0]
diff --git a/examples/corelib/serialization/savegame/level.cpp b/examples/corelib/serialization/savegame/level.cpp
index 6fe46e8938..ea6ef147b9 100644
--- a/examples/corelib/serialization/savegame/level.cpp
+++ b/examples/corelib/serialization/savegame/level.cpp
@@ -62,12 +62,12 @@ QString Level::name() const
return mName;
}
-QVector<Character> Level::npcs() const
+QList<Character> Level::npcs() const
{
return mNpcs;
}
-void Level::setNpcs(const QVector<Character> &npcs)
+void Level::setNpcs(const QList<Character> &npcs)
{
mNpcs = npcs;
}
diff --git a/examples/corelib/serialization/savegame/level.h b/examples/corelib/serialization/savegame/level.h
index 393524abfd..ecffde8f22 100644
--- a/examples/corelib/serialization/savegame/level.h
+++ b/examples/corelib/serialization/savegame/level.h
@@ -52,7 +52,7 @@
#define LEVEL_H
#include <QJsonObject>
-#include <QVector>
+#include <QList>
#include "character.h"
@@ -65,8 +65,8 @@ public:
QString name() const;
- QVector<Character> npcs() const;
- void setNpcs(const QVector<Character> &npcs);
+ QList<Character> npcs() const;
+ void setNpcs(const QList<Character> &npcs);
void read(const QJsonObject &json);
void write(QJsonObject &json) const;
@@ -74,7 +74,7 @@ public:
void print(int indentation = 0) const;
private:
QString mName;
- QVector<Character> mNpcs;
+ QList<Character> mNpcs;
};
//! [0]
diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp
index 489ec24a4d..da44909893 100644
--- a/examples/corelib/tools/customtype/message.cpp
+++ b/examples/corelib/tools/customtype/message.cpp
@@ -61,7 +61,7 @@ Message::Message(const QString &body, const QStringList &headers)
QDebug operator<<(QDebug dbg, const Message &message)
{
const QString body = message.body();
- QVector<QStringRef> pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts);
+ QList<QStringRef> pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts);
if (pieces.isEmpty())
dbg.nospace() << "Message()";
else if (pieces.size() == 1)