Results 1 to 2 of 2

Thread: Alt+F4 isnt grabbed by QWidget::grabKeyboard()

  1. #1
    Join Date
    May 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Alt+F4 isnt grabbed by QWidget::grabKeyboard()

    Alt+F4 directly calls a CloseEvent instead of being grabbed. This cause a big problem for our App, because we want to reassign Alt+F4 for a different action (not a QAction) in our older Fortran code.

    Maybe someone has an idea how to solve this problem

    Greets
    Sebastian

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Alt+F4 isnt grabbed by QWidget::grabKeyboard()

    Alt+F4 is never sent to the widget but is directly sent to the Windows OS. look into qkeymapper_win.cpp, function
    bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool grab);
    see from where its called and how you can override this behaviour

Similar Threads

  1. grabbed QPixmap doesn't look right on XP
    By Cruz in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2009, 08:28

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.