Fix groupChanged signal not emitted in all cases.

This commit is contained in:
Florian Geyer 2012-04-21 12:15:21 +02:00 committed by Felix Geyer
parent b1db565bee
commit 4e2407b3ba
2 changed files with 8 additions and 1 deletions

View File

@ -31,7 +31,8 @@ GroupView::GroupView(Database* db, QWidget* parent)
setHeaderHidden(true);
setUniformRowHeights(true);
connect(this, SIGNAL(clicked(const QModelIndex&)), SLOT(emitGroupChanged(const QModelIndex&)));
connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
SLOT(emitGroupChanged()));
recInitExpanded(db->rootGroup());
@ -72,3 +73,8 @@ void GroupView::setModel(QAbstractItemModel* model)
Q_UNUSED(model);
Q_ASSERT(false);
}
void GroupView::emitGroupChanged()
{
Q_EMIT groupChanged(currentGroup());
}

View File

@ -39,6 +39,7 @@ Q_SIGNALS:
private Q_SLOTS:
void expandedChanged(const QModelIndex& index);
void emitGroupChanged(const QModelIndex& index);
void emitGroupChanged();
private:
void recInitExpanded(Group* group);