I need to use macros to declare methods in my classes, some of which should be slots.
But MOC does not resolve macros, so I cannot simply put "public slots:" instead of "public:" declaration within the macro (see example below).
Is there a way of telling the MOC to create a slot from an already declared method?
An equivalent for hypothetical Q_DECLARE_SLOT macro in this (trivial) example:
#define MY_METHODS() \
public: \
int myMethod1( int a, int b ); \
int myMethod2( int a, int b );
{
Q_OBJECT
MY_METHODS();
Q_DECLARE_SLOT( int myMethod1 int int ); // or something similar
};
#define MY_METHODS() \
public: \
int myMethod1( int a, int b ); \
int myMethod2( int a, int b );
class MyClass : public QObject
{
Q_OBJECT
MY_METHODS();
Q_DECLARE_SLOT( int myMethod1 int int ); // or something similar
};
To copy to clipboard, switch view to plain text mode
Bookmarks