Results 1 to 6 of 6

Thread: Dialogs not closing with 'Apple + W' on mac.

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Dialogs not closing with 'Apple + W' on mac.

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Dialogs not closing with 'Apple + W' on mac.

    Hi,

    Try adding a QAction with the shortcut "Meta+w" to the dialog and connect it to a slot like "close()" or "reject()".
    Òscar Llarch i Galán

  3. #3
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Dialogs not closing with 'Apple + W' on mac.

    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.?

  4. #4
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dialogs not closing with 'Apple + W' on mac.

    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.

  5. #5
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Dialogs not closing with 'Apple + W' on mac.

    What do you mean by application level?
    I can not pass qApp as parent while creating the action.

  6. #6
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dialogs not closing with 'Apple + W' on mac.

    By 'application level' I mean main window. In the your subclass of QMainWidow you can create this action.

Similar Threads

  1. Dialog is not closing
    By manmohan in forum Newbie
    Replies: 5
    Last Post: 1st December 2008, 17:04
  2. Closing all of the mainWindow's child dialogs
    By JPNaude in forum Qt Programming
    Replies: 4
    Last Post: 2nd October 2008, 13:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.