GH-2101 fix enter and double click activation of instances
This commit is contained in:
parent
c214c13fb3
commit
74c598d756
@ -692,7 +692,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
|
|||||||
setCatBackground(cat_enable);
|
setCatBackground(cat_enable);
|
||||||
}
|
}
|
||||||
// start instance when double-clicked
|
// 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
|
// track the selection -- update the instance toolbar
|
||||||
connect(view->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::instanceChanged);
|
connect(view->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::instanceChanged);
|
||||||
|
@ -417,6 +417,12 @@ void GroupView::mouseDoubleClickEvent(QMouseEvent *event)
|
|||||||
// signal handlers may change the model
|
// signal handlers may change the model
|
||||||
QPersistentModelIndex persistent = index;
|
QPersistentModelIndex persistent = index;
|
||||||
emit doubleClicked(persistent);
|
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)
|
void GroupView::paintEvent(QPaintEvent *event)
|
||||||
|
Loading…
Reference in New Issue
Block a user