connect(list, SIGNAL(activated(const QModelIndex &)),
this, SLOT(onItemActivated(const QModelIndex &)));
+ connect(list, SIGNAL(itemSelectionChanged()),
+ this, SLOT(onItemSelectionChanged()));
+ connect(list, SIGNAL(itemSelectionChanged()),
+ this, SIGNAL(itemSelectionChanged()));
}
void ListWindow::populateList()
Q_UNUSED(title);
Q_UNUSED(receiver);
Q_UNUSED(slot);
- Q_UNUSED(iconPath);
+ Q_UNUSED(iconName);
#else
QAction *toolBarAction =
addToolBarAction(receiver, slot, iconName, title, true);
}
int row = index.row() - buttons.count();
- qDebug() << "Activated" << index.row() << ", emit activated(" << row << ")";
+ qDebug() << "Activated" << index.row() << ", emit activated(" << row
+ << ")";
emit activated(mModel->index(row, 0));
}
}
#endif // Q_WS_MAEMO_5
+
+void ListWindow::onItemSelectionChanged()
+{
+ TRACE;
+ bool enabled = currentItem().isValid();
+ foreach (QAction *action, itemActions) {
+ action->setEnabled(enabled);
+ }
+}