I create a class as follows:
{
public:
public slots:
};
class CTreeClass:public QTreeWidget
{
public:
CTreeClass(QWidget *parent);
public slots:
void showMessage(QTreeWidgetItem *item, int index);
};
To copy to clipboard, switch view to plain text mode
and in the function CTreeClass,the part of code as follows:
CTreeClass
::CTreeClass(QWidget *parent
){
...
....
}
CTreeClass::CTreeClass(QWidget *parent)
:QTreeWidget(parent)
{
...
QObject::connect(this,SIGNAL(itemClicked(QTreeWidgetItem *, int)),this,SLOT(showMessage(QTreeWidgetItem *, int)));
....
}
To copy to clipboard, switch view to plain text mode
The function showMessage is only show a message(as a test),but when I click the item of the tree,nothing does,Why?
Bookmarks