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.

Task-number: QTBUG-104164
Change-Id: I77260dc00d51d62ed1064e13f566d04e88d28ef9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 16a19a4f4ab207eba4ba6da987b31628b51903b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-06-13 09:34:12 +02:00 committed by Qt Cherry-pick Bot
parent df759d34eb
commit c325766423

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;