diff --git a/src/widgets/autoexpandingtreeview.cpp b/src/widgets/autoexpandingtreeview.cpp index 44dc30ef9..14469d27c 100644 --- a/src/widgets/autoexpandingtreeview.cpp +++ b/src/widgets/autoexpandingtreeview.cpp @@ -27,6 +27,7 @@ AutoExpandingTreeView::AutoExpandingTreeView(QWidget *parent) expand_on_reset_(true) { connect(this, SIGNAL(expanded(QModelIndex)), SLOT(ItemExpanded(QModelIndex))); + connect(this, SIGNAL(clicked(QModelIndex)), SLOT(ItemClicked(QModelIndex))); } void AutoExpandingTreeView::reset() { @@ -69,3 +70,7 @@ void AutoExpandingTreeView::ItemExpanded(const QModelIndex& index) { if (model()->rowCount(index) == 1 && auto_open_) expand(model()->index(0, 0, index)); } + +void AutoExpandingTreeView::ItemClicked(const QModelIndex& index) { + expand(index); +} diff --git a/src/widgets/autoexpandingtreeview.h b/src/widgets/autoexpandingtreeview.h index 4dc03e411..259e19299 100644 --- a/src/widgets/autoexpandingtreeview.h +++ b/src/widgets/autoexpandingtreeview.h @@ -42,6 +42,7 @@ class AutoExpandingTreeView : public QTreeView { private slots: void ItemExpanded(const QModelIndex& index); + void ItemClicked(const QModelIndex& index); private: bool RecursivelyExpand(const QModelIndex& index, int* count);