C++ (Qt)connect(ui->tree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(onCurrentChanged()));connect(ui->tree, SIGNAL(itemClicked(QTreeWidgetItem *, int )), this, SLOT(updateIt())); void onCurrentChanged(){ ... что-то делаем updateIt();}
QTreeWidgetItem *m_lastItem;
changed clicked changed clicked