summaryrefslogtreecommitdiffhomepage
path: root/compat/qt-signal.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-12-19 16:44:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2021-12-19 16:44:42 +0100
commit7edc2c3950c708f06e4d6435872ff329fdd35e14 (patch)
tree61f37d885ba49b485e50d9cddb2db78662224c19 /compat/qt-signal.hpp
parentb9a3909834826f035e639a196cc0f8cf7e20ca55 (diff)
compat/qt-signal: remove crap that only qt_signal<void> needs
Diffstat (limited to 'compat/qt-signal.hpp')
-rw-r--r--compat/qt-signal.hpp37
1 files changed, 16 insertions, 21 deletions
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<void> { 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<typename t, typename F> \
- 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<type>; \
- OTR_GENERATE_SIGNAL2(qlist##type); \
- template<> struct sig<type> { using t = sig_##type; }; \
+# define OTR_GENERATE_SIGNAL(type) \
+ OTR_GENERATE_SIGNAL2(type); \
+ using qlist##type = QList<type>; \
+ OTR_GENERATE_SIGNAL2(qlist##type); \
+ template<> struct sig<type> { using t = sig_##type; }; \
template<> struct sig<qlist##type> { using t = qlist##type; }
using slider_value = options::slider_value;