This matches what happens when you double-click on a cell.
@@ -474,10 +474,7 @@ void AbstractTableView::doubleclick_event(MouseEvent& event)
if (event.y() < header_height())
return;
if (!selection().is_empty()) {
- if (is_editable())
- begin_editing(selection().first());
- else
- activate_selected();
+ activate_or_edit_selected();
}
@@ -362,7 +362,15 @@ void AbstractView::doubleclick_event(MouseEvent& event)
else if (!m_selection.contains(index))
set_selection(index);
+}
+
+void AbstractView::activate_or_edit_selected()
+{
+ if (is_editable())
+ begin_editing(selection().first());
+ else
+ activate_selected();
void AbstractView::context_menu_event(ContextMenuEvent& event)
@@ -100,6 +100,7 @@ protected:
void set_hovered_index(const ModelIndex&);
void activate(const ModelIndex&);
void activate_selected();
+ void activate_or_edit_selected();
void update_edit_widget_position();
bool m_editable { false };
@@ -159,7 +159,7 @@ void TableView::keydown_event(KeyEvent& event)
auto& model = *this->model();
if (event.key() == KeyCode::Key_Return) {
if (event.key() == KeyCode::Key_Left) {