PDA

View Full Version : Dialogs not closing with 'Apple + W' on mac.



kaushal_gaurav
13th March 2009, 04:20
Hi,

I have a requirement of closing the dialogs with keys 'Apple + w' on MAC but this is not happening in my application.
How can i achieve this on MAC?

Please help...............


Regards,
GK

^NyAw^
13th March 2009, 09:18
Hi,

Try adding a QAction with the shortcut "Meta+w" to the dialog and connect it to a slot like "close()" or "reject()".

kaushal_gaurav
16th March 2009, 10:14
But i want this for each dialog of the whole application. The application has too many dialogs, then i have to do this for each and every dialog.

Can there be a simple solution.?

munna
16th March 2009, 10:36
I don't think you have to do this for every dialog. Only the current dialog needs to be closed when 'Apple + W' is used. Therefore, at the application level implement an action for this shortcut and then close the dialog which has the focus.

kaushal_gaurav
16th March 2009, 10:55
What do you mean by application level?
I can not pass qApp as parent while creating the action.

munna
16th March 2009, 11:07
By 'application level' I mean main window. In the your subclass of QMainWidow you can create this action.