Results 1 to 5 of 5

Thread: Intercept ShowDesktop event

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    122
    Thanks
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Intercept ShowDesktop event

    Hi,
    maybe thi is Windows specific.
    Is there a way to intercept the ShowDesktop event inside a qt application.
    I would like to minimize my window when that happens.
    I'm using a frameless window, so I would like the same behaviour as an ordinary window.

    bye

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Intercept ShowDesktop event

    If it is sent as a Windows native event, you can reimplement QWidget::winEvent() or QCoreApplication::winEventFilter().

  3. #3
    Join Date
    Jan 2006
    Posts
    122
    Thanks
    16
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Intercept ShowDesktop event

    Yes, I tried that but I'm not sure I can intercept that particular event.
    Maybe that one is more related to the QApplication rather than the widget.

    thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Intercept ShowDesktop event

    It might be forwarded only to top level widgets(main windows), because it makes no sense to send such an event to a child widget.

    So try catching it in the main window's winEvent.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Intercept ShowDesktop event

    Applying a filter on the application object should work. You should intercept all such events passing through the application this way.

Similar Threads

  1. Replies: 1
    Last Post: 16th October 2007, 22:41
  2. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05
  3. Workload in a QThread blocks main application's event loop ?
    By 0xBulbizarre in forum Qt Programming
    Replies: 14
    Last Post: 9th April 2006, 21:55

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
  •  
Qt is a trademark of The Qt Company.