Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Ctrl+V goes to wrong widget
If I set the paste shortcut on my treeview, place the cursor into a custom editor component, and do Ctrl+V - the treeview steals the paste action despite being out of focus.
How do I go about debugging this? Ctrl+V works fine in the editor component without the shortcut set on the treeview.
If you have this shortcut defined by
QActionit probably has too wide of a context. The default context for these classes is
Qt::WindowShortcut, which means the shortcut triggers if the focus is anywhere in the window. You can change it to
Qt::WidgetWithChildrenShortcutto scope it to the treeview alone.
Nice, that helped, but now right after pasting the focus changes from the treeview to the next input line after it. How can I have the focus stay where it is after a paste?
Hiding an unrelated widget was changing the focus. Weird, but I'll work around it. Thanks for your help!