I am attempting to control a QStackedWidget with a QTreeWidget.
Both are initialized in the constructor of my class.

To do so, I use the following code:

Qt Code:
  1. //optionLabels is a QTreeWidget*
  2. //optionControls is a QStackedWidget*
  3.  
  4. void EditOptionsDialog::makeConnections() {
  5. connect(optionLabels, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(changeCollectionPane(QTreeWidgetItem*, int)));
  6. }
  7.  
  8. //This is defined as a slot in the header file
  9. void EditOptionsDialog::changeCollectionPane(QTreeWidgetItem* selection, int col) {
  10. QMessageBox::information(this, tr("Is this slot called?"), tr("Index of Clicked Widget: %1").arg(selection->data(col, Qt::UserRole).toInt()));
  11. if(selection && col == 0) {
  12. optionControls->setCurrentIndex(selection->data(col, Qt::UserRole).toInt());
  13. }
  14. }
To copy to clipboard, switch view to plain text mode 

When I click around on the tree, I don't get a message box, so the slot is not being called. Any ideas as to why?