aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/pen.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-01 16:06:29 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-02 16:51:12 +0200
commit9f0eb243cd264ae4f174ba38a1c958f42d338c80 (patch)
tree7955ddd930356f1c221a01a1b7a1d59f6a3120e4 /sources/shiboken6/tests/libsample/pen.h
parente2a3fa037b8133d857b34ddcecf1afe156095a4f (diff)
shiboken6: Add support for operator bool
[ChangeLog][shiboken6] operator bool can now be used for bool conversions (nb_bool) besides Qt-style isNull() methods. Add a command line option --use-operator-bool-as-nb_nonzero similar to use-isnull-as-nb_nonzero, enabling the use of operator bool for bool conversions. Make it possible to override both settings in typesystem XML. Task-number: PYSIDE-1334 Change-Id: I9c567e1b2cb97b22b41b3d9918046d793632160e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/libsample/pen.h')
-rw-r--r--sources/shiboken6/tests/libsample/pen.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/shiboken6/tests/libsample/pen.h b/sources/shiboken6/tests/libsample/pen.h
index 20977fdeb..4feb9f540 100644
--- a/sources/shiboken6/tests/libsample/pen.h
+++ b/sources/shiboken6/tests/libsample/pen.h
@@ -44,6 +44,26 @@ private:
bool m_null;
};
+class LIBSAMPLE_API Brush
+{
+public:
+ enum Style { Solid, Cross };
+
+ explicit Brush(const Color &c = {});
+
+ operator bool() const;
+
+ Style style() const;
+ void setStyle(Style newStyle);
+
+ const Color &color() const;
+ void setColor(const Color &newColor);
+
+private:
+ Style m_style = Solid;
+ Color m_color;
+};
+
class LIBSAMPLE_API Pen
{
public: