I'm trying to compile the following code according to wysota suggestion and I'm getting an error:
QState *s1 = new QState();
QState *s2 = new QState();
QSignalTransition *t1 = s1->addTransition(this, SIGNAL(t1_sg()), s2);
QObject::connect(t1,
SIGNAL(triggered
()),
this,
SLOT(t1_slot
()));
QState *s1 = new QState();
QState *s2 = new QState();
QSignalTransition *t1 = s1->addTransition(this, SIGNAL(t1_sg()), s2);
QObject::connect(t1, SIGNAL(triggered()), this, SLOT(t1_slot()));
To copy to clipboard, switch view to plain text mode
This is the error:
'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : can't convert from 'QSignalTransition *' to 'const QObject *'
As far as I know QSignalTransition inherits from QObject, why can't it convert it?
I'm trying to compile the following code according to wysota suggestion and I'm getting an error:
QState *s1 = new QState();
QState *s2 = new QState();
QSignalTransition *t1 = s1->addTransition(this, SIGNAL(t1_sg()), s2);
QObject::connect(t1,
SIGNAL(triggered
()),
this,
SLOT(t1_slot
()));
QState *s1 = new QState();
QState *s2 = new QState();
QSignalTransition *t1 = s1->addTransition(this, SIGNAL(t1_sg()), s2);
QObject::connect(t1, SIGNAL(triggered()), this, SLOT(t1_slot()));
To copy to clipboard, switch view to plain text mode
This is the error:
'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : can't convert from 'QSignalTransition *' to 'const QObject *'
As far as I know QSignalTransition inherits from QObject, why can't it convert it?
Added after 11 minutes:
I have found the problem, I had included this:
#include <QAbstractTransition>
#include <QAbstractTransition>
To copy to clipboard, switch view to plain text mode
instead of:
#include <QSignalTransition>
#include <QSignalTransition>
To copy to clipboard, switch view to plain text mode
Bookmarks