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?

Qt Code:
  1. Receiver recv;
  2. 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:

Qt Code:
  1. class Receiver:public QObject{
  2. Q_OBJECT;
  3.  
  4.  
  5. public slots:
  6. void selected(QModelIndex &);
  7.  
  8. };
To copy to clipboard, switch view to plain text mode