From 9f0eb243cd264ae4f174ba38a1c958f42d338c80 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 1 Jul 2021 16:06:29 +0200 Subject: 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 Reviewed-by: Cristian Maureira-Fredes --- sources/shiboken6/tests/libsample/pen.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sources/shiboken6/tests/libsample/pen.h') 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: -- cgit v1.2.3