diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-12 22:03:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-16 17:53:40 +0200 |
commit | 9ca593d3ed203df4404f051dad426b04e6624512 (patch) | |
tree | abdbe138ee3b1d42a54acd1387c65beaa2310a18 /compat/util.hpp | |
parent | 546f9c503d6050251d9a623803b37ecb23f096fe (diff) |
compat/util: replace with QSignalBlocker usages
Diffstat (limited to 'compat/util.hpp')
-rw-r--r-- | compat/util.hpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/compat/util.hpp b/compat/util.hpp index 453d94bd..20be92a4 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -23,29 +23,6 @@ void run_in_thread_async(QObject* obj, F&& fun) QObject::connect(&src, &QObject::destroyed, obj, std::move(fun), Qt::AutoConnection); } -class inhibit_qt_signals final -{ - QObject& val; - bool operate_p; - -public: - inhibit_qt_signals(QObject& val) : val(val), operate_p(!val.signalsBlocked()) - { - 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()) {} -}; - template<typename t, typename u, typename w> auto clamp(t val, u min, w max) -> decltype (val * min * max) { |