+#elif defined(Q_OS_SYMBIAN)
+ action = new QAction(title, this);
+ connect(action, SIGNAL(triggered()), receiver, slot);
+ action->setSoftKeyRole(QAction::PositiveSoftKey);
+ menuBar()->addAction(action);
+#else
+ Q_UNUSED(title);
+ Q_UNUSED(receiver);
+ Q_UNUSED(slot);
+ action = new QAction(this);
+#endif
+ action->setCheckable(true);
+ return action;
+}
+
+void ListWindow::onItemActivated(const QModelIndex &index)
+{
+ TRACE;
+
+ // Work around Qt/Symbian^3 bug: Disabled list items still can be selected
+ if (!mModel) {
+ return;
+ }
+ if (!mModel->rowCount()) {
+ return;
+ }
+
+ int row = index.row() - buttons.count();
+ qDebug() << "Activated" << index.row() << ", emit activated(" << row << ")";
+ emit activated(mModel->index(row, 0));
+}
+
+void ListWindow::setCurrentItem(const QModelIndex &item)
+{
+ int index = item.row();
+ list->setCurrentItem(list->item(index + buttons.count()));
+}
+
+QModelIndex ListWindow::currentItem() const
+{
+ TRACE;
+ QListWidgetItem *currentItem = list->currentItem();
+ if (currentItem) {
+ int row = list->row(currentItem) - buttons.count();
+ qDebug() << "Current row is" << row;
+ return mModel->index(row, 0);
+ }
+ return QModelIndex();