thru
28th April 2009, 12:02
I am a very beginner learing by trial and error (well I have read a bit already). I was seeing the most simple example, dirview and I though I'd add some code, an object that would be signaled by the TreeView.
So I created a class derived from QObject with the Q_OBJECT macro and set a connection (code below) but the return value of connect is always false.
What I am missing?
And is there a way to get extended information of the error?
Receiver recv;
bool ok=QObject::connect(&tree,SIGNAL(activated(const QModelIndex &)),&recv,SLOT(selected(const ModelIndex &)));
this is the declaration of Receiver class:
class Receiver:public QObject{
Q_OBJECT;
public slots:
void selected(QModelIndex &);
};
So I created a class derived from QObject with the Q_OBJECT macro and set a connection (code below) but the return value of connect is always false.
What I am missing?
And is there a way to get extended information of the error?
Receiver recv;
bool ok=QObject::connect(&tree,SIGNAL(activated(const QModelIndex &)),&recv,SLOT(selected(const ModelIndex &)));
this is the declaration of Receiver class:
class Receiver:public QObject{
Q_OBJECT;
public slots:
void selected(QModelIndex &);
};