diff options
| -rw-r--r-- | compat/qt-signal.hpp | 37 | 
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; | 
