prakash437
17th May 2010, 01:11
Dear All,
I am pretty new to Qt and I accept this could well be a dumb question.
I dont understand why the slot connection is not working here !!
I have a simple form, with a button, and a tree widget. I have created a custom class for the tree widget, as in here and promoted it in the Qt designer !!
class QFileBrowser : public QTreeWidget
{
..
public slots:
void onFilesFoldersSelected();
};
The main window has a signal defined as follows !!
signals:
void filesFoldersSelected();
the signals and slot are connected as here !!
QObject::connect(this, SIGNAL(filesFoldersSelected()), ui->twFileBrowser, SLOT(onFilesFoldersSelected()));
But i see that i never land in the slot function. I have debugged and at the emitting part of the signal, it is assumed that nothing is connected.
if (!sender->d_func()->isSignalConnected(signal_index))
return; // nothing connected to these signals, and no spy .... returns here !! slot is not called !!
Could anyone please explain what I am doing wrong ??
Thanks for your time,
Prakash
I am pretty new to Qt and I accept this could well be a dumb question.
I dont understand why the slot connection is not working here !!
I have a simple form, with a button, and a tree widget. I have created a custom class for the tree widget, as in here and promoted it in the Qt designer !!
class QFileBrowser : public QTreeWidget
{
..
public slots:
void onFilesFoldersSelected();
};
The main window has a signal defined as follows !!
signals:
void filesFoldersSelected();
the signals and slot are connected as here !!
QObject::connect(this, SIGNAL(filesFoldersSelected()), ui->twFileBrowser, SLOT(onFilesFoldersSelected()));
But i see that i never land in the slot function. I have debugged and at the emitting part of the signal, it is assumed that nothing is connected.
if (!sender->d_func()->isSignalConnected(signal_index))
return; // nothing connected to these signals, and no spy .... returns here !! slot is not called !!
Could anyone please explain what I am doing wrong ??
Thanks for your time,
Prakash