diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-06 13:13:05 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-07-07 11:48:45 +0200 |
commit | 77bb50de8f3f7defe1329e6c4a6e066d510afc55 (patch) | |
tree | 758b5aab51211aaba887e3ffe9bb4d46f9e740cf /src/widgets/doc | |
parent | 989fca660c3556fa957ed9a3f7cd3b948a4166a2 (diff) |
Use QList instead of QVector in qtbase
Fixes all other QVector occurrences
Task-number: QTBUG-84469
Change-Id: I5f9311298d341a9a3061a6a640539583d1618939
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/doc')
-rw-r--r-- | src/widgets/doc/snippets/code/doc_src_layout.cpp | 10 | ||||
-rw-r--r-- | src/widgets/doc/src/widgets-and-layouts/layout.qdoc | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/doc/snippets/code/doc_src_layout.cpp b/src/widgets/doc/snippets/code/doc_src_layout.cpp index 7bbd781bb2..3cf5ffbef4 100644 --- a/src/widgets/doc/snippets/code/doc_src_layout.cpp +++ b/src/widgets/doc/snippets/code/doc_src_layout.cpp @@ -53,7 +53,7 @@ #define CARD_H #include <QtWidgets> -#include <QVector> +#include <QList> class CardLayout : public QLayout { @@ -73,7 +73,7 @@ public: void setGeometry(const QRect &rect) override; private: - QVector<QLayoutItem*> m_items; + QList<QLayoutItem *> m_items; }; #endif //! [0] @@ -86,7 +86,7 @@ private: //! [2] int CardLayout::count() const { - // QVector::size() returns the number of QLayoutItems in m_items + // QList::size() returns the number of QLayoutItems in m_items return m_items.size(); } //! [2] @@ -94,14 +94,14 @@ int CardLayout::count() const //! [3] QLayoutItem *CardLayout::itemAt(int idx) const { - // QVector::value() performs index checking, and returns nullptr if we are + // QList::value() performs index checking, and returns nullptr if we are // outside the valid range return m_items.value(idx); } QLayoutItem *CardLayout::takeAt(int idx) { - // QVector::take does not do index checking + // QList::take does not do index checking return idx >= 0 && idx < m_items.size() ? m_items.takeAt(idx) : 0; } //! [3] diff --git a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc index 24f8cd836f..c72c3e8c68 100644 --- a/src/widgets/doc/src/widgets-and-layouts/layout.qdoc +++ b/src/widgets/doc/src/widgets-and-layouts/layout.qdoc @@ -299,7 +299,7 @@ \list \li A data structure to store the items handled by the layout. Each item is a \l{QLayoutItem}{QLayoutItem}. We will use a - QVector in this example. + QList in this example. \li \l{QLayout::}{addItem()}, how to add items to the layout. \li \l{QLayout::}{setGeometry()}, how to perform the layout. \li \l{QLayout::}{sizeHint()}, the preferred size of the layout. |