diff --git a/examples/corelib/serialization/convert/converter.h b/examples/corelib/serialization/convert/converter.h index 82e1fa1cb30..56b501a076b 100644 --- a/examples/corelib/serialization/convert/converter.h +++ b/examples/corelib/serialization/convert/converter.h @@ -54,9 +54,9 @@ #include #include #include -#include +#include -class VariantOrderedMap : public QVector> +class VariantOrderedMap : public QList> { public: VariantOrderedMap() = default; diff --git a/examples/corelib/serialization/convert/main.cpp b/examples/corelib/serialization/convert/main.cpp index e9d14792b0c..161fec6bcd1 100644 --- a/examples/corelib/serialization/convert/main.cpp +++ b/examples/corelib/serialization/convert/main.cpp @@ -58,12 +58,12 @@ #include -static QVector *availableConverters; +static QList *availableConverters; Converter::Converter() { if (!availableConverters) - availableConverters = new QVector; + availableConverters = new QList; availableConverters->append(this); } diff --git a/examples/corelib/serialization/savegame/doc/src/savegame.qdoc b/examples/corelib/serialization/savegame/doc/src/savegame.qdoc index e20cb6bc6cd..7f138ff1105 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 58fc087b1f4..bb7c2013f29 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 Game::levels() const +QList Game::levels() const { return mLevels; } @@ -80,7 +80,7 @@ void Game::newGame() mLevels.reserve(2); Level village(QStringLiteral("Village")); - QVector villageNpcs; + QList 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 dungeonNpcs; + QList 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 3da9c148be7..dfcb27eb1c8 100644 --- a/examples/corelib/serialization/savegame/game.h +++ b/examples/corelib/serialization/savegame/game.h @@ -52,7 +52,7 @@ #define GAME_H #include -#include +#include #include "character.h" #include "level.h" @@ -66,7 +66,7 @@ public: }; Character player() const; - QVector levels() const; + QList levels() const; void newGame(); bool loadGame(SaveFormat saveFormat); @@ -78,7 +78,7 @@ public: void print(int indentation = 0) const; private: Character mPlayer; - QVector mLevels; + QList mLevels; }; //! [0] diff --git a/examples/corelib/serialization/savegame/level.cpp b/examples/corelib/serialization/savegame/level.cpp index 6fe46e89387..ea6ef147b9c 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 Level::npcs() const +QList Level::npcs() const { return mNpcs; } -void Level::setNpcs(const QVector &npcs) +void Level::setNpcs(const QList &npcs) { mNpcs = npcs; } diff --git a/examples/corelib/serialization/savegame/level.h b/examples/corelib/serialization/savegame/level.h index 393524abfd0..ecffde8f228 100644 --- a/examples/corelib/serialization/savegame/level.h +++ b/examples/corelib/serialization/savegame/level.h @@ -52,7 +52,7 @@ #define LEVEL_H #include -#include +#include #include "character.h" @@ -65,8 +65,8 @@ public: QString name() const; - QVector npcs() const; - void setNpcs(const QVector &npcs); + QList npcs() const; + void setNpcs(const QList &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 mNpcs; + QList mNpcs; }; //! [0] diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp index 489ec24a4d5..da44909893d 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 pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts); + QList pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts); if (pieces.isEmpty()) dbg.nospace() << "Message()"; else if (pieces.size() == 1) diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp index 076dfdfd0b2..74a1ad0161d 100644 --- a/examples/network/download/main.cpp +++ b/examples/network/download/main.cpp @@ -63,7 +63,7 @@ class DownloadManager: public QObject { Q_OBJECT QNetworkAccessManager manager; - QVector currentDownloads; + QList currentDownloads; public: DownloadManager(); diff --git a/examples/network/fortuneserver/server.h b/examples/network/fortuneserver/server.h index 96d71451480..bf0bcbc9b51 100644 --- a/examples/network/fortuneserver/server.h +++ b/examples/network/fortuneserver/server.h @@ -53,7 +53,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE class QLabel; @@ -76,7 +76,7 @@ private: QLabel *statusLabel = nullptr; QTcpServer *tcpServer = nullptr; - QVector fortunes; + QList fortunes; }; //! [0] diff --git a/examples/network/googlesuggest/googlesuggest.cpp b/examples/network/googlesuggest/googlesuggest.cpp index 2cba43178ea..04a60103b2e 100644 --- a/examples/network/googlesuggest/googlesuggest.cpp +++ b/examples/network/googlesuggest/googlesuggest.cpp @@ -148,7 +148,7 @@ bool GSuggestCompletion::eventFilter(QObject *obj, QEvent *ev) //! [4] //! [5] -void GSuggestCompletion::showCompletion(const QVector &choices) +void GSuggestCompletion::showCompletion(const QList &choices) { if (choices.isEmpty()) return; @@ -210,7 +210,7 @@ void GSuggestCompletion::handleNetworkData(QNetworkReply *networkReply) { QUrl url = networkReply->url(); if (networkReply->error() == QNetworkReply::NoError) { - QVector choices; + QList choices; QByteArray response(networkReply->readAll()); QXmlStreamReader xml(response); diff --git a/examples/network/googlesuggest/googlesuggest.h b/examples/network/googlesuggest/googlesuggest.h index a0b0ac069c0..909386569b4 100644 --- a/examples/network/googlesuggest/googlesuggest.h +++ b/examples/network/googlesuggest/googlesuggest.h @@ -64,7 +64,7 @@ public: explicit GSuggestCompletion(QLineEdit *parent = nullptr); ~GSuggestCompletion(); bool eventFilter(QObject *obj, QEvent *ev) override; - void showCompletion(const QVector &choices); + void showCompletion(const QList &choices); public slots: diff --git a/examples/network/multistreamclient/client.h b/examples/network/multistreamclient/client.h index c22a245eba4..220be087769 100644 --- a/examples/network/multistreamclient/client.h +++ b/examples/network/multistreamclient/client.h @@ -52,7 +52,7 @@ #define CLIENT_H #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -81,7 +81,7 @@ private slots: void writeDatagram(const QByteArray &ba); private: - QVector consumers; + QList consumers; QSctpSocket *sctpSocket; QComboBox *hostCombo; diff --git a/examples/network/multistreamserver/server.h b/examples/network/multistreamserver/server.h index 2380d6ffd68..bbfc653ee1d 100644 --- a/examples/network/multistreamserver/server.h +++ b/examples/network/multistreamserver/server.h @@ -52,7 +52,7 @@ #define SERVER_H #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -81,7 +81,7 @@ private slots: void writeDatagram(QSctpSocket *to, const QByteArray &ba); private: - QVector providers; + QList providers; QSctpServer *sctpServer; QList connections; diff --git a/examples/network/secureudpclient/mainwindow.h b/examples/network/secureudpclient/mainwindow.h index 0d443fd376f..6f207cecd95 100644 --- a/examples/network/secureudpclient/mainwindow.h +++ b/examples/network/secureudpclient/mainwindow.h @@ -52,7 +52,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -99,7 +99,7 @@ private: Ui::MainWindow *ui = nullptr; using AssocPtr = QSharedPointer; - QVector connections; + QList connections; QString nameTemplate; unsigned nextId = 0; diff --git a/examples/network/secureudpserver/nicselector.h b/examples/network/secureudpserver/nicselector.h index 7962a783188..e3c9d376398 100644 --- a/examples/network/secureudpserver/nicselector.h +++ b/examples/network/secureudpserver/nicselector.h @@ -53,7 +53,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE @@ -78,7 +78,7 @@ public: private: Ui::NicSelector *ui = nullptr; - QVector availableAddresses; + QList availableAddresses; }; #endif // NICSELECTOR_H diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp index 2ba44768618..035cf665bb4 100644 --- a/examples/network/torrent/torrentclient.cpp +++ b/examples/network/torrent/torrentclient.cpp @@ -1086,7 +1086,7 @@ void TorrentClient::scheduleUploads() // seeding, we sort by upload speed. Seeds are left out; there's // no use in unchoking them. QList allClients = d->connections; - QVector> transferSpeeds; + QList> transferSpeeds; for (PeerWireClient *client : qAsConst(allClients)) { if (client->state() == QAbstractSocket::ConnectedState && client->availablePieces().count(true) != d->pieceCount) { @@ -1373,7 +1373,7 @@ void TorrentClient::requestMore(PeerWireClient *client) int TorrentClient::requestBlocks(PeerWireClient *client, TorrentPiece *piece, int maxBlocks) { // Generate the list of incomplete blocks for this piece. - QVector bits; + QList bits; int completedBlocksSize = piece->completedBlocks.size(); for (int i = 0; i < completedBlocksSize; ++i) { if (!piece->completedBlocks.testBit(i) && !piece->requestedBlocks.testBit(i)) diff --git a/examples/opengl/hellogl2/logo.h b/examples/opengl/hellogl2/logo.h index 2f3dc7e6490..5b6c3973f71 100644 --- a/examples/opengl/hellogl2/logo.h +++ b/examples/opengl/hellogl2/logo.h @@ -52,7 +52,7 @@ #define LOGO_H #include -#include +#include #include class Logo @@ -68,7 +68,7 @@ private: void extrude(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); void add(const QVector3D &v, const QVector3D &n); - QVector m_data; + QList m_data; int m_count = 0; }; diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h index 76f2afb549b..d4dcbcf3dbe 100644 --- a/examples/opengl/hellowindow/hellowindow.h +++ b/examples/opengl/hellowindow/hellowindow.h @@ -83,8 +83,8 @@ private: void quad(qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4); void extrude(qreal x1, qreal y1, qreal x2, qreal y2); - QVector vertices; - QVector normals; + QList vertices; + QList normals; int vertexAttr; int normalAttr; int matrixUniform; diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp index 89c84696629..a480fe5726f 100644 --- a/examples/opengl/qopenglwidget/glwidget.cpp +++ b/examples/opengl/qopenglwidget/glwidget.cpp @@ -319,7 +319,7 @@ void GLWidget::initializeGL() // let's do something different and potentially more efficient: create a // properly interleaved data set. const int vertexCount = m_vertices.count(); - QVector buf; + QList buf; buf.resize(vertexCount * 3 * 2); GLfloat *p = buf.data(); for (int i = 0; i < vertexCount; ++i) { diff --git a/examples/opengl/qopenglwidget/glwidget.h b/examples/opengl/qopenglwidget/glwidget.h index 99288261c0f..50f8aa9be50 100644 --- a/examples/opengl/qopenglwidget/glwidget.h +++ b/examples/opengl/qopenglwidget/glwidget.h @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include class Bubble; @@ -101,10 +101,10 @@ private: qreal m_fAngle = 0; qreal m_fScale = 1; bool m_showBubbles = true; - QVector m_vertices; - QVector m_normals; + QList m_vertices; + QList m_normals; bool m_qtLogo = true; - QVector m_bubbles; + QList m_bubbles; int m_frames = 0; QElapsedTimer m_time; QOpenGLShader *m_vshader1 = nullptr; diff --git a/examples/opengl/qopenglwidget/mainwindow.h b/examples/opengl/qopenglwidget/mainwindow.h index bec1a563e08..43cc55100e1 100644 --- a/examples/opengl/qopenglwidget/mainwindow.h +++ b/examples/opengl/qopenglwidget/mainwindow.h @@ -77,7 +77,7 @@ private: QGridLayout *m_layout; int m_nextX; int m_nextY; - QVector m_glWidgets; + QList m_glWidgets; }; #endif diff --git a/examples/opengl/textures/glwidget.cpp b/examples/opengl/textures/glwidget.cpp index be5a46e5324..2ef17c511cc 100644 --- a/examples/opengl/textures/glwidget.cpp +++ b/examples/opengl/textures/glwidget.cpp @@ -199,7 +199,7 @@ void GLWidget::makeObject() for (int j = 0; j < 6; ++j) textures[j] = new QOpenGLTexture(QImage(QString(":/images/side%1.png").arg(j + 1)).mirrored()); - QVector vertData; + QList vertData; for (int i = 0; i < 6; ++i) { for (int j = 0; j < 4; ++j) { // vertex position diff --git a/examples/opengl/threadedqopenglwidget/glwidget.h b/examples/opengl/threadedqopenglwidget/glwidget.h index 8dc84dd0b17..2bff56c471e 100644 --- a/examples/opengl/threadedqopenglwidget/glwidget.h +++ b/examples/opengl/threadedqopenglwidget/glwidget.h @@ -91,8 +91,8 @@ private: bool m_inited = false; qreal m_fAngle = 0; qreal m_fScale = 1; - QVector vertices; - QVector normals; + QList vertices; + QList normals; QOpenGLShaderProgram program; QOpenGLBuffer vbo; int vertexAttr = 0; diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp index c277111813e..cf4fd7e4561 100644 --- a/examples/qtconcurrent/progressdialog/main.cpp +++ b/examples/qtconcurrent/progressdialog/main.cpp @@ -61,10 +61,10 @@ int main(int argc, char **argv) const int iterations = 20; - // Prepare the vector. - QVector vector; + // Prepare the list. + QList list; for (int i = 0; i < iterations; ++i) - vector.append(i); + list.append(i); // Create a progress dialog. QProgressDialog dialog; @@ -88,7 +88,7 @@ int main(int argc, char **argv) }; // Start the computation. - futureWatcher.setFuture(QtConcurrent::map(vector, spin)); + futureWatcher.setFuture(QtConcurrent::map(list, spin)); // Display the dialog and start the event loop. dialog.exec(); diff --git a/examples/vulkan/hellovulkancubes/renderer.cpp b/examples/vulkan/hellovulkancubes/renderer.cpp index da493de739b..faf86bcbfc6 100644 --- a/examples/vulkan/hellovulkancubes/renderer.cpp +++ b/examples/vulkan/hellovulkancubes/renderer.cpp @@ -96,7 +96,7 @@ Renderer::Renderer(VulkanWindow *w, int initialCount) void Renderer::preInitResources() { - const QVector sampleCounts = m_window->supportedSampleCounts(); + const QList sampleCounts = m_window->supportedSampleCounts(); if (DBG) qDebug() << "Supported sample counts:" << sampleCounts; if (sampleCounts.contains(4)) { diff --git a/examples/vulkan/hellovulkantexture/main.cpp b/examples/vulkan/hellovulkantexture/main.cpp index 1144463b70d..bb6103e9cff 100644 --- a/examples/vulkan/hellovulkantexture/main.cpp +++ b/examples/vulkan/hellovulkantexture/main.cpp @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) VulkanWindow w; w.setVulkanInstance(&inst); if (QCoreApplication::arguments().contains(QStringLiteral("--srgb"))) - w.setPreferredColorFormats(QVector() << VK_FORMAT_B8G8R8A8_SRGB); + w.setPreferredColorFormats(QList() << VK_FORMAT_B8G8R8A8_SRGB); w.resize(1024, 768); w.show(); diff --git a/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp b/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp index cf95a0e6a06..e1b527b6a3d 100644 --- a/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp +++ b/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp @@ -170,7 +170,7 @@ void VulkanRenderer::initResources() m_window->colorFormat(), m_window->depthStencilFormat()); info += QStringLiteral("Supported sample counts:"); - const QVector sampleCounts = m_window->supportedSampleCounts(); + const QList sampleCounts = m_window->supportedSampleCounts(); for (int count : sampleCounts) info += QLatin1Char(' ') + QString::number(count); info += QLatin1Char('\n'); diff --git a/examples/vulkan/shared/trianglerenderer.cpp b/examples/vulkan/shared/trianglerenderer.cpp index b48f5640036..988d1de75e4 100644 --- a/examples/vulkan/shared/trianglerenderer.cpp +++ b/examples/vulkan/shared/trianglerenderer.cpp @@ -73,7 +73,7 @@ TriangleRenderer::TriangleRenderer(QVulkanWindow *w, bool msaa) : m_window(w) { if (msaa) { - const QVector counts = w->supportedSampleCounts(); + const QList counts = w->supportedSampleCounts(); qDebug() << "Supported sample counts:" << counts; for (int s = 16; s >= 4; s /= 2) { if (counts.contains(s)) { diff --git a/examples/widgets/animation/stickman/animation.cpp b/examples/widgets/animation/stickman/animation.cpp index 73d79adc840..77a1875be30 100644 --- a/examples/widgets/animation/stickman/animation.cpp +++ b/examples/widgets/animation/stickman/animation.cpp @@ -79,7 +79,7 @@ public: } private: - QVector m_nodePositions; + QList m_nodePositions; }; Animation::Animation() : m_currentFrame(0) diff --git a/examples/widgets/animation/stickman/animation.h b/examples/widgets/animation/stickman/animation.h index 5cc1133ac06..93caff48a27 100644 --- a/examples/widgets/animation/stickman/animation.h +++ b/examples/widgets/animation/stickman/animation.h @@ -53,7 +53,7 @@ #include #include -#include +#include class Frame; QT_BEGIN_NAMESPACE @@ -85,7 +85,7 @@ public: private: QString m_name; - QVector m_frames; + QList m_frames; int m_currentFrame; }; diff --git a/examples/widgets/animation/sub-attaq/animationmanager.h b/examples/widgets/animation/sub-attaq/animationmanager.h index 5ddea66e80f..a097e7508e9 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 animations; + QList animations; }; #endif // ANIMATIONMANAGER_H diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.h b/examples/widgets/animation/sub-attaq/graphicsscene.h index dd3719bc100..ce9ee115ca7 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> submarines; + QList> submarines; }; GraphicsScene(int x, int y, int width, int height, Mode mode, QObject *parent = nullptr); @@ -114,7 +114,7 @@ private: QSet submarines; QSet bombs; QSet torpedos; - QVector submarinesData; + QList submarinesData; QHash levelsData; friend class PauseState; diff --git a/examples/widgets/doc/src/addressbook.qdoc b/examples/widgets/doc/src/addressbook.qdoc index ed2b8e90e61..22769cb2707 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} and one that takes - \c {QVector} as an argument, for convenience. + \c TableModel's own \c {QList} and one that takes + \c {QList} 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 object that holds all the contacts in the address + QList 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 431815d0c11..4a6a482ff22 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 24be09a7a90..16cb0656dbb 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 618b387ed58..30dc685843e 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 35e3b1e29fe..a2782155039 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 40dd654af6e..0ac4719d747 100644 --- a/examples/widgets/draganddrop/puzzle/puzzlewidget.h +++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.h @@ -53,7 +53,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -94,7 +94,7 @@ private: int findPiece(const QRect &pieceRect) const; const QRect targetSquare(const QPoint &position) const; - QVector pieces; + QList 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 fb5351f9492..072ec2b2161 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 &gestures) +void ImageWidget::grabGestures(const QList &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 ae5eb7bc2b5..f9b5d989e97 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 &gestures); + void grabGestures(const QList &gestures); protected: bool event(QEvent *event) override; diff --git a/examples/widgets/gestures/imagegestures/main.cpp b/examples/widgets/gestures/imagegestures/main.cpp index 4f8d4ec15ec..ecd7462bd37 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 gestures; + QList 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 d1c786a93a7..c4e63e9e7d8 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 &gestures) +void MainWidget::grabGestures(const QList &gestures) { imageWidget->grabGestures(gestures); } diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h index 16005972514..794f052f3ce 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 &gestures); + void grabGestures(const QList &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 f3d54e62959..6c36ccb6d3d 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 stuff; + QList stuff; }; #endif // CHIP_H diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.h b/examples/widgets/graphicsview/diagramscene/diagramitem.h index ffaea4b7a81..0fc286b2a88 100644 --- a/examples/widgets/graphicsview/diagramscene/diagramitem.h +++ b/examples/widgets/graphicsview/diagramscene/diagramitem.h @@ -52,7 +52,7 @@ #define DIAGRAMITEM_H #include -#include +#include QT_BEGIN_NAMESPACE class QPixmap; @@ -88,7 +88,7 @@ private: DiagramType myDiagramType; QPolygonF myPolygon; QMenu *myContextMenu; - QVector arrows; + QList arrows; }; //! [0] diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp index a067f82ad7c..51e179a4641 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 nodes; + QList nodes; const QList items = scene()->items(); for (QGraphicsItem *item : items) { if (Node *node = qgraphicsitem_cast(item)) diff --git a/examples/widgets/graphicsview/elasticnodes/node.cpp b/examples/widgets/graphicsview/elasticnodes/node.cpp index a67e21c4b3f..8d44a167fa0 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 Node::edges() const +QList Node::edges() const { return edgeList; } diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h index b160ff37cc5..5ccc52595cd 100644 --- a/examples/widgets/graphicsview/elasticnodes/node.h +++ b/examples/widgets/graphicsview/elasticnodes/node.h @@ -52,7 +52,7 @@ #define NODE_H #include -#include +#include class Edge; class GraphWidget; @@ -64,7 +64,7 @@ public: Node(GraphWidget *graphWidget); void addEdge(Edge *edge); - QVector edges() const; + QList edges() const; enum { Type = UserType + 1 }; int type() const override { return Type; } @@ -83,7 +83,7 @@ protected: void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; private: - QVector edgeList; + QList edgeList; QPointF newPos; GraphWidget *graph; }; diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.h b/examples/widgets/graphicsview/flowlayout/flowlayout.h index c6758414d69..14251072ec5 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 m_items; + QList 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 0edaa686b45..dd4e3661da7 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 words = sentence.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts); + const QList 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 6a9097a7365..263909225e4 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 pixmaps; + QList 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 ef757c47fb2..a056eae1c50 100644 --- a/examples/widgets/graphicsview/padnavigator/flippablepad.h +++ b/examples/widgets/graphicsview/padnavigator/flippablepad.h @@ -53,7 +53,7 @@ #include "roundrectitem.h" -#include +#include //! [0] class FlippablePad : public RoundRectItem @@ -64,7 +64,7 @@ public: RoundRectItem *iconAt(int column, int row) const; private: - QVector > iconGrid; + QList> iconGrid; }; //! [0] diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.cpp b/examples/widgets/graphicsview/padnavigator/padnavigator.cpp index dbf89dd3188..5088386a265 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> 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 b1b65174ee3..25706d1abe4 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 contacts; + QList contacts; QDataStream in(&file); in >> contacts; diff --git a/examples/widgets/itemviews/addressbook/tablemodel.cpp b/examples/widgets/itemviews/addressbook/tablemodel.cpp index ddf79a3fa3c..aac4c920607 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 &contacts, QObject *parent) - : QAbstractTableModel(parent), - contacts(contacts) +TableModel::TableModel(const QList &contacts, QObject *parent) + : QAbstractTableModel(parent), contacts(contacts) { } //! [0] @@ -186,7 +185,7 @@ Qt::ItemFlags TableModel::flags(const QModelIndex &index) const //! [7] //! [8] -const QVector &TableModel::getContacts() const +const QList &TableModel::getContacts() const { return contacts; } diff --git a/examples/widgets/itemviews/addressbook/tablemodel.h b/examples/widgets/itemviews/addressbook/tablemodel.h index e4025fc7340..c5bac4f4a46 100644 --- a/examples/widgets/itemviews/addressbook/tablemodel.h +++ b/examples/widgets/itemviews/addressbook/tablemodel.h @@ -52,7 +52,7 @@ #define TABLEMODEL_H #include -#include +#include //! [0] @@ -83,7 +83,7 @@ class TableModel : public QAbstractTableModel public: TableModel(QObject *parent = nullptr); - TableModel(const QVector &contacts, QObject *parent = nullptr); + TableModel(const QList &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 &getContacts() const; + const QList &getContacts() const; private: - QVector contacts; + QList contacts; }; //! [0] diff --git a/examples/widgets/itemviews/chart/pieview.cpp b/examples/widgets/itemviews/chart/pieview.cpp index c640c78f3e6..af77970633d 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 &roles) +void PieView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, + const QList &roles) { QAbstractItemView::dataChanged(topLeft, bottomRight, roles); diff --git a/examples/widgets/itemviews/chart/pieview.h b/examples/widgets/itemviews/chart/pieview.h index 22c74dde817..f92a4434636 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 &roles = QVector()) override; + const QList &roles = QList()) 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 25e196a80c8..fde82accfda 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 > list = - {{ tr("Alice"), QColor("aliceblue") }, - { tr("Neptun"), QColor("aquamarine") }, - { tr("Ferdinand"), QColor("springgreen") }}; + const QList> 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 027a5f8849e..e82c84a4241 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 &data, TreeItem *parent) - : itemData(data), - parentItem(parent) +TreeItem::TreeItem(const QList &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 data(columns); + QList 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 867be5f380e..b23697efe31 100644 --- a/examples/widgets/itemviews/editabletreemodel/treeitem.h +++ b/examples/widgets/itemviews/editabletreemodel/treeitem.h @@ -52,13 +52,13 @@ #define TREEITEM_H #include -#include +#include //! [0] class TreeItem { public: - explicit TreeItem(const QVector &data, TreeItem *parent = nullptr); + explicit TreeItem(const QList &data, TreeItem *parent = nullptr); ~TreeItem(); TreeItem *child(int number); @@ -74,8 +74,8 @@ public: bool setData(int column, const QVariant &value); private: - QVector childItems; - QVector itemData; + QList childItems; + QList itemData; TreeItem *parentItem; }; //! [0] diff --git a/examples/widgets/itemviews/editabletreemodel/treemodel.cpp b/examples/widgets/itemviews/editabletreemodel/treemodel.cpp index 9678e45be7f..1161a8b5d20 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 rootData; + QList 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 parents; - QVector indentations; + QList parents; + QList 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 columnData; + QList 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 519164999d4..5422757d959 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(rows, Node())) + rc(rows), + cc(columns), + tree(new QList(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(rc, Node(parent)); - QVector *v = parent ? parent->children : tree; + parent->children = new QList(rc, Node(parent)); + QList *v = parent ? parent->children : tree; return const_cast(&(v->at(row))); } diff --git a/examples/widgets/itemviews/interview/model.h b/examples/widgets/itemviews/interview/model.h index 132f1d01aaa..ee64a32f934 100644 --- a/examples/widgets/itemviews/interview/model.h +++ b/examples/widgets/itemviews/interview/model.h @@ -54,7 +54,7 @@ #include #include #include -#include +#include class Model : public QAbstractItemModel { @@ -83,7 +83,7 @@ private: Node(Node *parent = nullptr) : parent(parent), children(nullptr) {} ~Node() { delete children; } Node *parent; - QVector *children; + QList *children; }; Node *node(int row, Node *parent) const; @@ -93,7 +93,7 @@ private: QIcon services; int rc; int cc; - QVector *tree; + QList *tree; QFileIconProvider iconProvider; }; diff --git a/examples/widgets/itemviews/puzzle/piecesmodel.h b/examples/widgets/itemviews/puzzle/piecesmodel.h index 2a966037073..99cd7677b50 100644 --- a/examples/widgets/itemviews/puzzle/piecesmodel.h +++ b/examples/widgets/itemviews/puzzle/piecesmodel.h @@ -55,7 +55,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE class QMimeData; @@ -83,8 +83,8 @@ public: void addPieces(const QPixmap &pixmap); private: - QVector locations; - QVector pixmaps; + QList locations; + QList pixmaps; int m_PieceSize; }; diff --git a/examples/widgets/itemviews/puzzle/puzzlewidget.h b/examples/widgets/itemviews/puzzle/puzzlewidget.h index 40dd654af6e..0ac4719d747 100644 --- a/examples/widgets/itemviews/puzzle/puzzlewidget.h +++ b/examples/widgets/itemviews/puzzle/puzzlewidget.h @@ -53,7 +53,7 @@ #include #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -94,7 +94,7 @@ private: int findPiece(const QRect &pieceRect) const; const QRect targetSquare(const QPoint &position) const; - QVector pieces; + QList 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 41fe24e7377..f998432252d 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 &data, TreeItem *parent) +TreeItem::TreeItem(const QList &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 390433597d8..10c5dda35cc 100644 --- a/examples/widgets/itemviews/simpletreemodel/treeitem.h +++ b/examples/widgets/itemviews/simpletreemodel/treeitem.h @@ -52,13 +52,13 @@ #define TREEITEM_H #include -#include +#include //! [0] class TreeItem { public: - explicit TreeItem(const QVector &data, TreeItem *parentItem = nullptr); + explicit TreeItem(const QList &data, TreeItem *parentItem = nullptr); ~TreeItem(); void appendChild(TreeItem *child); @@ -71,8 +71,8 @@ public: TreeItem *parentItem(); private: - QVector m_childItems; - QVector m_itemData; + QList m_childItems; + QList m_itemData; TreeItem *m_parentItem; }; //! [0] diff --git a/examples/widgets/itemviews/simpletreemodel/treemodel.cpp b/examples/widgets/itemviews/simpletreemodel/treemodel.cpp index 28640d6433a..d94fdb08cd1 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 parents; - QVector indentations; + QList parents; + QList 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 columnData; + QList 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 af869badc90..0314755b34c 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 m_paths; - QVector m_advances; + QList m_paths; + QList 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 cb1a0177e95..76d5818d32e 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 points; + QList 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 439bcb2cd0d..412c2da6a4f 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 dashes; + QList 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 b559ed2ba08..e7e78b641b0 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 m_points; - QVector m_vectors; + QList m_points; + QList 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 6bf1cafe4ea..3c6f356e1bc 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 m_locks; + QList 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 8ac5a8cdce0..2b8fd518afa 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 constraints; + QList 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 0a24224b56a..163b01cda63 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 highlightingRules; + QList highlightingRules; QRegularExpression commentStartExpression; QRegularExpression commentEndExpression; diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp index 3305ac90325..44c5b1312ae 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 parents(10); + QList 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 01447ef5415..6e728ca7a9c 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 m_shapeList; + QList 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 96cb6f008e9..8a1ef8a3c44 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 IconPreviewArea::iconModes() +QList IconPreviewArea::iconModes() { - static const QVector result = {QIcon::Normal, QIcon::Active, QIcon::Disabled, QIcon::Selected}; + static const QList result = { QIcon::Normal, QIcon::Active, QIcon::Disabled, + QIcon::Selected }; return result; } -QVector IconPreviewArea::iconStates() +QList IconPreviewArea::iconStates() { - static const QVector result = {QIcon::Off, QIcon::On}; + static const QList result = { QIcon::Off, QIcon::On }; return result; } diff --git a/examples/widgets/widgets/icons/iconpreviewarea.h b/examples/widgets/widgets/icons/iconpreviewarea.h index 6ea35a5230d..5387cb9f6d9 100644 --- a/examples/widgets/widgets/icons/iconpreviewarea.h +++ b/examples/widgets/widgets/icons/iconpreviewarea.h @@ -54,7 +54,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE class QLabel; @@ -71,8 +71,8 @@ public: void setIcon(const QIcon &icon); void setSize(const QSize &size); - static QVector iconModes(); - static QVector iconStates(); + static QList iconModes(); + static QList iconStates(); static QStringList iconModeNames(); static QStringList iconStateNames(); diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h index 785154746e5..3d0cecea2bf 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 shapeItems; + QList shapeItems; QPainterPath circlePath; QPainterPath squarePath; QPainterPath trianglePath;