Results 1 to 10 of 10

Thread: Maximize Window Signal

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Maximize Window Signal

    I need to repaint my directshow video after I maximize and minimized Qt App. I have been told there is a signal that is sent when the window is maximized/redisplayed, but what is the actual signal? I cannot find it in google or here so far. Thanks for your help!

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

    Default Re: Maximize Window Signal

    You can reimplemet resizeEvent and repaint in it.

  3. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximize Window Signal

    So resizeEvent is the signal that is sent out when I maximize or restore the window from a minimized state? Thanks!

  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: Maximize Window Signal

    resizeEvent is not a signal. You have to reimplement this function in your class and do your painting here.

  5. #5
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximize Window Signal

    If resizeEvent is not a signal, how does it know to be called upon restoring my window? Thanks again and sorry if I am not getting this, it just doesn't seem clear to me.

  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: Maximize Window Signal

    resizeEvent will automatically be called whenever your window is resized.

  7. #7
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Maximize Window Signal

    Does the resizeEvent( ) function take in any arguments? Like a widht and height arguments? Thanks again!

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Maximize Window Signal

    For maximizing, the resize event is fine. For restoring, it is not.
    A window is not resized when it is restored from the minimized state, catch show event instead.

    Quote Originally Posted by ToddAtWSU
    Does the resizeEvent( ) function take in any arguments? Like a widht and height arguments? Thanks again!
    http://doc.trolltech.com/4.1/qwidget.html#resizeEvent
    http://doc.trolltech.com/4.1/qwidget.html#showEvent
    Either subclass and override those above mentioned virtual functions, or catch according events by an event filter.

    Edit:
    Quote Originally Posted by ToddAtWSU
    I cannot find it in google or here so far
    Still if google is nice and knows a lot, how about using docs (assistant/online) as the number #1 reference...
    Last edited by jpn; 3rd May 2006 at 21:06.
    J-P Nurmi

  9. #9
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Maximize Window Signal

    Using resizeEvent() and showEvent() is just looking for trouble if what you are actually interested in is maximize/restore.

    Just override QWidget::changeEvent(QEvent*) and check the event type for QEvent::WindowStateChange
    Save yourself some pain. Learn C++ before learning Qt.

  10. The following 2 users say thank you to Chicken Blood Machine for this useful post:

    macias (24th June 2007), WinchellChung (3rd July 2007)

  11. #10
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Re: Maximize Window Signal

    Sorry but maybe I was a little confusing on what I want to do. What I want to do is if I have the video player at the front of my screen and then click on an internet browser to bring it to the front and then click on the video player to bring it back to the front. So, I am not resizing or minimizing/maximizing the window. I have tried Show, Paint, ApplicationActivated, ApplicationChange, FocusIn, and Resize as events to handle. Does anyone know which event it is that I want to handle or if there is a better way to go about this? Thanks again!!!!

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  3. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  4. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  5. Maximize Window button of Manin Window
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 1st August 2007, 08:20

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.