FreeCAD
FreeCAD copied to clipboard
Spreadsheet: Delete key doesn't clear contents in selected cells
Is there an existing issue for this?
- [X] I have searched the existing issues
Problem description
Hitting the delete key when one or more cells are selected will normally clear their contents. This doesn't seem to be happening at the moment.
Full version info
OS: macOS 12.7.5
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37898 (Git)
Build type: Release
Branch: main
Hash: 308013fb975ec3bf0dc5cb616ef76a4095e71cc5
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: C/Default (C)
Installed mods:
* A2plus 0.4.64
Subproject(s) affected?
None
Anything else?
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I cannot reproduce on Windows and
OS: macOS 13.6.7
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37898 (Git)
Build type: Release
Branch: main
Hash: 308013fb975ec3bf0dc5cb616ef76a4095e71cc5
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: C/Default (C)
Installed mods:
* freecad.gears 1.2.0
* OpenTheme 2024.6.22
* CfdOF 1.26.1
* Defeaturing 1.2.2
* Manipulator 1.5.7
* fasteners 0.5.24
* CurvedShapes 1.0.9
* sheetmetal 0.4.20
* Curves 0.6.40
I can confirm. Would not surprise me if this is a Macintosh specific issue.
OS: macOS 14.5
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37928 (Git)
Build type: Release
Branch: main
Hash: e7699b531eba4bee262f7214699f07b96f66ba7b
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: C/Default (C)
Installed mods:
* FeedsAndSpeeds 0.5.0
* OpenTheme 2024.6.22
The context menu of the spread sheet has a Delete command. When clicking on it does it clear the selection?
The problem is the implementation of SheetTableView::event(). It compares the value of the key event with Qt::Key_Delete and this works fine for Windows and Linux but not for macOS because it defines a different shortcut (Forward Delete or Meta + D)
So, the platform-independent implementation should be:
if (kevent->matches(QKeySequence::Delete)) {
deleteSelection();
}
Please test: https://github.com/FreeCAD/FreeCAD/pull/15057
This looks like the same problem in the Sketcher: #15068