Permalink
Browse files

GH-2101 fix enter and double click activation of instances

  • Loading branch information...
peterix committed Nov 22, 2018
1 parent c214c13 commit 74c598d756107be817989d87bd4ccf9d1a182e90
Showing with 7 additions and 1 deletion.
  1. +1 −1 application/MainWindow.cpp
  2. +6 −0 application/groupview/GroupView.cpp
@@ -692,7 +692,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
setCatBackground(cat_enable);
}
// start instance when double-clicked
connect(view, &GroupView::doubleClicked, this, &MainWindow::instanceActivated);
connect(view, &GroupView::activated, this, &MainWindow::instanceActivated);
// track the selection -- update the instance toolbar
connect(view->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::instanceChanged);
@@ -417,6 +417,12 @@ void GroupView::mouseDoubleClickEvent(QMouseEvent *event)
// signal handlers may change the model
QPersistentModelIndex persistent = index;
emit doubleClicked(persistent);
QStyleOptionViewItem option = viewOptions();
if ((model()->flags(index) & Qt::ItemIsEnabled) && !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this))
{
emit activated(index);
}
}
void GroupView::paintEvent(QPaintEvent *event)

0 comments on commit 74c598d

Please sign in to comment.