I have a Ui class with a function that i want to call every time i emit a signal from a class lets say test. in the ui function i need to connect my signal and slot but im trying the code from the QT docs and having no luck
signal declaration
signals:
void paint(int x, int y, int id);
signal emit
emit paint(x, y, id)
connection (m_test
been a class object)
connect(&m_test,SIGNAL(paint(int,int,int)), this, SLOT(uiFunction(int,int,int)));
getting this error
error: C2664: 'QMetaObject::Connection QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : cannot convert parameter 1 from 'uiFunction *' to 'const QObject *'
but i follwed this QT docs example (counter being the class)
Counter a, b;
QObject::connect(&a, SIGNAL(valueChanged(int)),
&b, SLOT(setValue(int)));
any ideas?
m_test
type does not derive fromQObject
. – cmannett85a small example
– AngryDuckclass Counter : public QObject
... Try again. – cmannett85