Modal Dialog does not blocking the user input.
-
Dear Friends,
I am having one issue regarding the modal dialog. basically it should stop user input. I set the window modality(setWindowModality(Qt::ApplicationModal);) it blocking the mouse click but unable to stop the tab key navigation and you can say keyboard input still i can give.I want to stop both mouse click plus keyborad input when dialog are pop up.Please suggest a solution if you have.TIA
[Edit ~aha_1980: model -> modal]
-
Hi
Can you show the code?
It should block any interaction with the windows behind it. -
Actually the scenario is like i have a QWidget(parent) that holds another widget which have the layout in which we have 3 buttons Yes ,No and Cancel. Basicly my requirement is if I am navigating through the tab button then focus should go on Yes,No and Cancel buttons afterwards again in Yes button.I mean it should be cyclic.
I tried so many things.raise(); activateWindow(); setFocusPolicy(Qt::StrongFocus); setWindowModality(Qt::ApplicationModal);
I also tried in evenfilter and overrided the keyEvent->key() == Qt::Key_Tab from there i return the true.So from this i am able to solve my first problem which i posted first but now u want tab focus should be cyclic(Yes,No and Cancel buttons).
Please advise something i am really stuck.
-
@Sebastian
Hi
TabOrder you can set in editor
so make sure the buttons are 1,2,3 and nothing else can take focus.
-
Hi,
Why not use a QDialog with QDialogButtonBox ?