X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftabular_decoder%2Fview.cpp;h=91bcaea197bee2a0645d9f314fb77c2f5053df21;hp=4715b4a90b5070444238779e682f42a4dc98eb7e;hb=20c99cfc69d3c7430817abd9a1f810698deb4a18;hpb=49a0a40345eb84be2c953c5f83cd0c9ccada6360 diff --git a/pv/views/tabular_decoder/view.cpp b/pv/views/tabular_decoder/view.cpp index 4715b4a9..91bcaea1 100644 --- a/pv/views/tabular_decoder/view.cpp +++ b/pv/views/tabular_decoder/view.cpp @@ -139,6 +139,14 @@ QSize CustomTableView::sizeHint() const return minimumSizeHint(); } +void CustomTableView::keyPressEvent(QKeyEvent *event) +{ + if ((event->key() == Qt::Key_Return) || (event->key() == Qt::Key_Enter)) + activatedByKey(currentIndex()); + else + QTableView::keyPressEvent(event); +} + View::View(Session &session, bool is_main_view, QMainWindow *parent) : ViewBase(session, is_main_view, parent), @@ -239,6 +247,8 @@ View::View(Session &session, bool is_main_view, QMainWindow *parent) : this, SLOT(on_table_item_clicked(const QModelIndex&))); connect(table_view_, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(on_table_item_double_clicked(const QModelIndex&))); + connect(table_view_, SIGNAL(activatedByKey(const QModelIndex&)), + this, SLOT(on_table_item_double_clicked(const QModelIndex&))); connect(table_view_->horizontalHeader(), SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(on_table_header_requested(const QPoint&)));