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
&)));
Receiver recv;
bool ok=QObject::connect(&tree,SIGNAL(activated(const QModelIndex &)),&recv,SLOT(selected(const ModelIndex &)));
To copy to clipboard, switch view to plain text mode
this is the declaration of Receiver class:
Q_OBJECT;
public slots:
};
class Receiver:public QObject{
Q_OBJECT;
public slots:
void selected(QModelIndex &);
};
To copy to clipboard, switch view to plain text mode
Bookmarks