Macro: Fix shortcuts in macro editor #26807
- The initial commit to block shortcuts in text edit fields (particularly for MacOS, where those shortcuts would activate FreeCAD functionality rather than text edit functionality) made a wrong assumption. - It assumed that there were no text edit fields where we would want to actually use application shortcuts. In retrospect, this was very wrong, and I completely missed the macro editor. - For now, it should be fine to change the field to only cover 'LineEdit'. I cannot imagine a case where you'd want to (e.g.) save text/document from a LineEdit, but if anyone knows of one then please let me know. - This does mean there are some quirks. For example in the materials editor, the description is a TextEdit field. Some text editing shortcuts won't work in here now (similar to how they didn't before the original commit that I made). - I've since learned that freecad also has a text editor functionality, I've tested that now Cmd+S works for save as it should.
This commit is contained in:
@@ -315,10 +315,7 @@ bool ShortcutManager::eventFilter(QObject* o, QEvent* ev)
|
||||
auto* maybeProxy = focus->focusProxy();
|
||||
auto* focusOrProxy = maybeProxy ? maybeProxy : focus;
|
||||
|
||||
bool isFocusedWidgetTextInput = focusOrProxy->inherits("QLineEdit")
|
||||
|| focusOrProxy->inherits("QTextEdit")
|
||||
|| focusOrProxy->inherits("QPlainTextEdit");
|
||||
if (isFocusedWidgetTextInput) {
|
||||
if (focusOrProxy->inherits("QLineEdit")) {
|
||||
ev->accept();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user