PDA

View Full Version : Behaviour difference between Mac OSX and Windows for shortcut and menu item



Thuan Seah Tan
29th July 2015, 07:40
Hi guys,

I was wondering if anyone has experience working on both Mac and PC and trying to get it to behave the same way.

Our application has a tree view which user can double click on item to bring up the line edit to rename them. On PC this works fine and as expected but on Mac it is a different story. On Mac, the undo shortcut key doesn't get consumed by the line edit (it has StrongFocus) and instead goes to our application (to a QAction that has the undo shortcut key set). This causes a problem for our app because in some circumstances, the undo can result in the line edit to lose focus and pushes an undoable command while undoing. Also, on Mac, it is possible to have the line edit not lose focus when user bring up the menu via the menu bar. This means they can trigger an application undo which gives us the same problem as before.

Is there any way to get Qt to behave the same as on Windows (i.e. the shortcut key goes to the line edit and bringing up the menu causes the line edit to lose focus)?