PDA

View Full Version : Maximize Window Signal



ToddAtWSU
3rd May 2006, 14:48
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!

munna
3rd May 2006, 15:12
You can reimplemet resizeEvent and repaint in it.

ToddAtWSU
3rd May 2006, 15:13
So resizeEvent is the signal that is sent out when I maximize or restore the window from a minimized state? Thanks!

munna
3rd May 2006, 15:16
resizeEvent is not a signal. You have to reimplement this function in your class and do your painting here.

ToddAtWSU
3rd May 2006, 15:23
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.

munna
3rd May 2006, 16:39
resizeEvent will automatically be called whenever your window is resized.

ToddAtWSU
3rd May 2006, 20:15
Does the resizeEvent( ) function take in any arguments? Like a widht and height arguments? Thanks again!

jpn
3rd May 2006, 20:59
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.


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 (http://doc.trolltech.com/4.1/eventsandfilters.html).

Edit:

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... ;)

Chicken Blood Machine
3rd May 2006, 21:13
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

ToddAtWSU
8th May 2006, 20:05
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!!!!