QSignalBlocker: plaster with [[nodiscard]]

It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: I77260dc00d51d62ed1064e13f566d04e88d28ef9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-06-13 09:34:12 +02:00
parent 6fc908c001
commit 16a19a4f4a

View File

@ -436,13 +436,16 @@ inline QBindingStorage *qGetBindingStorage(QObject *o)
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
#endif
class QSignalBlocker
class [[nodiscard]] QSignalBlocker
{
public:
Q_NODISCARD_CTOR
inline explicit QSignalBlocker(QObject *o) noexcept;
Q_NODISCARD_CTOR
inline explicit QSignalBlocker(QObject &o) noexcept;
inline ~QSignalBlocker();
Q_NODISCARD_CTOR
inline QSignalBlocker(QSignalBlocker &&other) noexcept;
inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;