From 7edc2c3950c708f06e4d6435872ff329fdd35e14 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Dec 2021 16:44:42 +0100 Subject: compat/qt-signal: remove crap that only qt_signal needs --- compat/qt-signal.hpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'compat') diff --git a/compat/qt-signal.hpp b/compat/qt-signal.hpp index 1b4e94d2..f74de642 100644 --- a/compat/qt-signal.hpp +++ b/compat/qt-signal.hpp @@ -21,7 +21,7 @@ public: { connect(this, &sig_void::notify, datum, f, conntype); } - sig_void(QObject* parent = nullptr); + explicit sig_void(QObject* parent = nullptr); void operator()() const { notify(); } signals: @@ -33,28 +33,23 @@ template<> struct sig { using t = sig_void; }; #ifndef OTR_GENERATE_SIGNAL3 # define OTR_GENERATE_SIGNAL3(x) #endif -#define OTR_GENERATE_SIGNAL2(type) \ - class OTR_COMPAT_EXPORT sig_##type final : public QObject \ - { \ - Q_OBJECT \ - public: \ - template \ - sig_##type(t* datum, F&& f, Qt::ConnectionType conntype = Qt::AutoConnection) : QObject(datum) \ - { \ - connect(this, &sig_##type::notify, datum, f, conntype); \ - } \ - sig_##type(QObject* parent = nullptr) : QObject(parent) {} \ - void operator()(const type& x) const; \ - Q_SIGNALS: \ - void notify(const type& x) const; \ - }; \ +#define OTR_GENERATE_SIGNAL2(type) \ + class OTR_COMPAT_EXPORT sig_##type final : public QObject \ + { \ + Q_OBJECT \ + public: \ + explicit sig_##type(QObject* parent = nullptr) : QObject(parent) {} \ + void operator()(const type& x) const; \ + Q_SIGNALS: \ + void notify(const type& x) const; \ + }; \ OTR_GENERATE_SIGNAL3(type) -# define OTR_GENERATE_SIGNAL(type) \ - OTR_GENERATE_SIGNAL2(type); \ - using qlist##type = QList; \ - OTR_GENERATE_SIGNAL2(qlist##type); \ - template<> struct sig { using t = sig_##type; }; \ +# define OTR_GENERATE_SIGNAL(type) \ + OTR_GENERATE_SIGNAL2(type); \ + using qlist##type = QList; \ + OTR_GENERATE_SIGNAL2(qlist##type); \ + template<> struct sig { using t = sig_##type; }; \ template<> struct sig { using t = qlist##type; } using slider_value = options::slider_value; -- cgit v1.2.3