I defined the signal in the macro:
Qt Code:
#define PROP_SINGLEVAL(prpname) \ private: \ int _##prpname; \ public: \ int& prpname () {return _##prpname;}; \ const int& ##prpname() const {return _##prpname;}; \ signals: \ void on##prpname##Change(); { Q_OBJECT public: options(); PROP_SINGLEVAL(val) };To copy to clipboard, switch view to plain text mode
It compiles but, when trying to connect the signal to the slot of another object instance, the message is that the signal on options:nvalChange() does not exist. I think I understand the reason for it (moc preprocessing does not expand the macro). Perhaps there is a way to make it work? I have many variables and for each one I want to provide the signal when it is changing.
Thanks.
Added after 7 minutes:
Can't find the way to delete the post, hence the answer: Q_SIGNAL
Bookmarks