[Interest] Are slots even needed these days?

Nikos Chantziaras realnc at gmail.com
Wed Mar 16 15:24:59 CET 2016


Since in modern Qt you connect signals to functions/lambdas, is there a 
reason to declare slots anymore?

In other words, is there any difference between:

   class Foo: public QObject {
       Q_OBJECT

   public slots:
       void bar();
   };

and:

   class Foo: public QObject {
       Q_OBJECT
   public:

       void bar();
   };

I can connect to Foo::bar either way. If I don't intend to ever use the 
old-style connect syntax, is there a reason to have "public slots:" anymore?




More information about the Interest mailing list