diff --git a/modules/gui/src/scene_win/scene_win.cc b/modules/gui/src/scene_win/scene_win.cc index 1a8f5c68e1c125ffb2886e2fc4df581c89380015..c97253b340cc87e8bf6ca67d2128e05184013946 100644 --- a/modules/gui/src/scene_win/scene_win.cc +++ b/modules/gui/src/scene_win/scene_win.cc @@ -57,6 +57,7 @@ SceneWin::SceneWin(QWidget* parent) : view_->setModel(model_); view_->setSelectionBehavior(QAbstractItemView::SelectRows); view_->setSelectionMode(QAbstractItemView::ExtendedSelection); + view_->setEditTriggers(QAbstractItemView::EditKeyPressed); view_->expandAll(); layout->addWidget(view_); @@ -67,6 +68,8 @@ SceneWin::SceneWin(QWidget* parent) : const QItemSelection&))); connect(view_, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ContextMenuRequested(const QPoint&))); + connect(view_, SIGNAL(doubleClicked(const QModelIndex &)), this, + SLOT(DoubleClicked(const QModelIndex &))); connect(model_, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(RowsInserted(const QModelIndex&, int, int))); } @@ -108,6 +111,9 @@ void SceneWin::RowsInserted(const QModelIndex & parent, int start, int end){ } } +void SceneWin::DoubleClicked(const QModelIndex & index){ + SceneSelection::Instance()->CenterOnObjects(); +} void SceneWin::AddView(gfx::EntityP entity, mol::EntityView view){ diff --git a/modules/gui/src/scene_win/scene_win.hh b/modules/gui/src/scene_win/scene_win.hh index 0cdf11540e601f49d5dde33c27a5fbc8f4b64b59..05706c5b676bc1029b973ad0a3f800bd1c6de1c6 100644 --- a/modules/gui/src/scene_win/scene_win.hh +++ b/modules/gui/src/scene_win/scene_win.hh @@ -66,6 +66,7 @@ public slots: private slots: void RowsInserted(const QModelIndex & parent, int start, int end); + void DoubleClicked(const QModelIndex & index); private: SceneWinModel* model_;