Results 1 to 2 of 2

Thread: VisualStudio plugin needs to know when app was minimized to tray

  1. #1
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default VisualStudio plugin needs to know when app was minimized to tray

    Hi, I'm new to QT
    I'm writing a VisualStudio addon which needs to know when app was minimized to tray
    I have a class which inherits QApplication, in the notify() method I catch the QEvent::WindowStateChange
    but I don't know how to distinguish between minimized and maximized events

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,019
    Thanks
    280
    Thanked 817 Times in 806 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: VisualStudio plugin needs to know when app was minimized to tray

    You need to implement QWidget::changeEvent() for your widget, and when the event type is QEvent::WindowStateChange you need to cast the QEvent pointer to QWindowStateChangeEvent. Once you have that, you can call the QWindowStateChangeEvent::oldState() method, which will tell you what the state was *before* it changed.

    You can also call QWidget::windowState() in the event handler to get the *current* state.

Similar Threads

  1. VisualStudio
    By sterling in forum Newbie
    Replies: 0
    Last Post: 24th January 2014, 21:40
  2. how to create its own tray(system tray) in QT application
    By Soumya Somasekhar Ram in forum Newbie
    Replies: 12
    Last Post: 6th September 2013, 13:23
  3. Integrating opencv with QT in visualstudio 2008
    By reem in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2010, 09:12
  4. Qt4 - VisualStudio 2005
    By JeffJones in forum Newbie
    Replies: 4
    Last Post: 22nd May 2007, 18:24
  5. Any Toolkit for designing VisualStudio-like GUIs?
    By burn2themax in forum Qt Programming
    Replies: 11
    Last Post: 29th July 2006, 10:00

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.