diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-21 17:38:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-23 00:05:15 +0200 |
commit | ac0b2beafe86bbeff20c81f58938ab22327e39e2 (patch) | |
tree | b96974ee941eaf7ede68eb3939f34afea0a0304e /compat | |
parent | d6dffea39f3546e29a0cf1689d7d83b84dedfd9d (diff) |
compat/util: add time-saving inhibit_qt_signals overloads
Diffstat (limited to 'compat')
-rw-r--r-- | compat/util.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compat/util.hpp b/compat/util.hpp index d2aaa572..33e64a80 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -34,11 +34,16 @@ public: if (operate_p) val.blockSignals(true); } + ~inhibit_qt_signals() { if (operate_p) val.blockSignals(false); } + + inhibit_qt_signals(QObject* val) : inhibit_qt_signals(*val) {} + inhibit_qt_signals(std::unique_ptr<QObject> val) : inhibit_qt_signals(*val.get()) {} + inhibit_qt_signals(std::shared_ptr<QObject> val) : inhibit_qt_signals(*val.get()) {} }; namespace detail { |