Unsolved QPushButton Enter/Return
-
Hello,
i have a dialog with 4 buttons on qdialogbuttonbox. I want that the user can switch the focus via tab and can active the buttons with enter/return (similar to space).
It works if i call setDefault(true) for every button, but i read in some post that only 1 buttons should be the "Default-Button".Is there a anthor way to make this work? Sure, i can install a eventfilter, but it sounds strange for me that there is not an easy way similar to setDefault(true).
-
Hi
Since enter has other roles, like for dialogs, they made key for press it
"spacebar".
So you can activate with keyboard. -
yes, i know that.
But my customers are used to press return for more then 20 years now and not spacebar. So what is the best solution? -
@Faema
well if setDefault works then use it?
Test with dialog to see if side effects :) -
@mrjj
i see no side effects so far, i hope it doesnt change with a qt update. -
@Faema
well worst case scenario with change in update
would be - it would close dialog on first button user hits enter on :)
But it seems to be clever enough not to do that if more than one "default".