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