summaryrefslogtreecommitdiffstats
path: root/examples/widgets/doc
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-09-06 22:38:45 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-09-17 23:05:23 +0200
commitcb54c16584cf3be746a1a536c1e37cb3022a2f1b (patch)
tree712a4ee8d6383918233654e1deeefb3e91371941 /examples/widgets/doc
parent7db335a77e9efcfc8e0d4c1bd0834100403ec3b1 (diff)
Cleanup QtWidgets (widgets) examples
Cleanup QtWidgets widgets examples: - use member-init (clang-tidy) - fix includes/don't include QtWidgets globally - include own header first - use nullptr (clang-tidy) - avoid c-style casts - use QVector instead QList Change-Id: Ib56bb507eb2ef885f1ddc664050d3c7af92adb70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/widgets/doc')
-rw-r--r--examples/widgets/doc/src/calculator.qdoc3
-rw-r--r--examples/widgets/doc/src/tooltips.qdoc2
2 files changed, 4 insertions, 1 deletions
diff --git a/examples/widgets/doc/src/calculator.qdoc b/examples/widgets/doc/src/calculator.qdoc
index e8f8030207..7d34a86c19 100644
--- a/examples/widgets/doc/src/calculator.qdoc
+++ b/examples/widgets/doc/src/calculator.qdoc
@@ -142,6 +142,9 @@
pendingAdditiveOperator and \c pendingMultiplicativeOperator
variables don't need to be initialized explicitly, because the
QString constructor initializes them to empty strings.
+ It is also possible to initialize those variable directly in the
+ header. This is called \c member-initializaton and avoids a long
+ initialization list.
\snippet widgets/calculator/calculator.cpp 1
\snippet widgets/calculator/calculator.cpp 2
diff --git a/examples/widgets/doc/src/tooltips.qdoc b/examples/widgets/doc/src/tooltips.qdoc
index a278215503..35e3b1e29f 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 QList, and we keep three
+ We keep all the shape items in a QVector, 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.