Make the edit entry button work.

This commit is contained in:
Felix Geyer 2011-12-29 19:01:58 +01:00
parent e11b0061d4
commit 73b84ff670
6 changed files with 46 additions and 1 deletions

View file

@ -29,6 +29,7 @@ EntryView::EntryView(QWidget* parent)
setRootIsDecorated(false);
connect(this, SIGNAL(activated(const QModelIndex&)), SLOT(emitEntryActivated(const QModelIndex&)));
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SIGNAL(entrySelectionChanged()));
}
void EntryView::setGroup(Group* group)
@ -46,3 +47,14 @@ void EntryView::setModel(QAbstractItemModel* model)
Q_UNUSED(model);
Q_ASSERT(false);
}
Entry* EntryView::currentEntry()
{
// TODO use selection instead of current?
return m_model->entryFromIndex(currentIndex());
}
bool EntryView::isSingleEntrySelected()
{
return (selectionModel()->selectedRows().size() == 1);
}