diff options
author | Oleksii Zbykovskyi <[email protected]> | 2025-08-06 11:19:18 +0200 |
---|---|---|
committer | Oleksii Zbykovskyi <[email protected]> | 2025-08-06 20:26:58 +0200 |
commit | 7564ea5f26f3b5d19abe245a0e10564c54fefd73 (patch) | |
tree | bd2bc749a0684943d9eebadbfa8026cb5d94decf | |
parent | 6fbd403fe7597f457e669bbb6551509c2097fc2d (diff) |
Combine senselessly divided snippets in customstyle
Customstyle has two functions, and each of them contains two snippet blocks.
These blocks are not used separately, so I combined each of them into one
and fixed the related documentation.
Task-number: QTBUG-137566
Change-Id: I539940c85970a8dfdb63daf531335ae4bf9d754b
Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r-- | src/widgets/doc/snippets/customstyle/customstyle.cpp | 10 | ||||
-rw-r--r-- | src/widgets/doc/src/widgets-and-layouts/styles.qdoc | 2 | ||||
-rw-r--r-- | src/widgets/styles/qstyle.cpp | 4 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/widgets/doc/snippets/customstyle/customstyle.cpp b/src/widgets/doc/snippets/customstyle/customstyle.cpp index 74de2705be8..72a04d2ae29 100644 --- a/src/widgets/doc/snippets/customstyle/customstyle.cpp +++ b/src/widgets/doc/snippets/customstyle/customstyle.cpp @@ -7,12 +7,12 @@ CustomStyle::CustomStyle(const QWidget *widget) { -//! [0] + //! [0] const QSpinBox *spinBox = qobject_cast<const QSpinBox *>(widget); if (spinBox) { -//! [0] //! [1] + //... } -//! [1] + //! [0] } //! [2] @@ -48,8 +48,6 @@ void CustomStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op painter->drawPolygon(points); } else { QProxyStyle::drawPrimitive(element, option, painter, widget); -//! [2] //! [3] } -//! [3] //! [4] } -//! [4] +//! [2] diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc index 62e433814be..e23811f6e70 100644 --- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc +++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc @@ -277,8 +277,6 @@ \snippet customstyle/customstyle.h 0 \codeline \snippet customstyle/customstyle.cpp 2 - \snippet customstyle/customstyle.cpp 3 - \snippet customstyle/customstyle.cpp 4 \section2 QStyle Functions diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index e72e645e69c..a7fbe885b88 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -229,8 +229,6 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C them differently: \snippet customstyle/customstyle.cpp 2 - \snippet customstyle/customstyle.cpp 3 - \snippet customstyle/customstyle.cpp 4 Notice that we don't use the \c widget argument, except to pass it on to the QWindowStyle::drawPrimitive() function. As mentioned @@ -243,8 +241,6 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C of the correct type before using it. For example: \snippet customstyle/customstyle.cpp 0 - \dots - \snippet customstyle/customstyle.cpp 1 When implementing a custom style, you cannot assume that the widget is a QSpinBox just because the enum value is called |