From b33478f8d09fa7112a805bbdc92e6002cb5c7e9b Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Wed, 13 Apr 2022 15:13:11 +0200 Subject: [PATCH] Sheet: update commands status when selection is changed Notice it doesn't cover the case of the context menu actions Partially fixes #6744 --- src/Mod/Spreadsheet/Gui/SheetTableView.cpp | 6 ++++++ src/Mod/Spreadsheet/Gui/SheetTableView.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index c4a6aa0352..c945f1cfe1 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -938,6 +938,12 @@ void SheetTableView::mousePressEvent(QMouseEvent* event) QTableView::mousePressEvent(event); } +void SheetTableView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) +{ + Gui::getMainWindow()->updateActions(); + QTableView::selectionChanged(selected, deselected); +} + void SheetTableView::edit ( const QModelIndex & index ) { currentEditIndex = index; diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.h b/src/Mod/Spreadsheet/Gui/SheetTableView.h index 490111c66a..e2deba3f4d 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.h +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.h @@ -89,6 +89,7 @@ protected: bool event(QEvent *event); void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint); void mousePressEvent(QMouseEvent* event); + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); void contextMenuEvent (QContextMenuEvent * e);