PDA

View Full Version : resizeEvent from parent to child?



ChasW
11th February 2007, 07:03
I have a dialog with a tab widget that is part of a grid layout. Within the tab widget is a frame. Within the frame is another widget that implements resizeEvent.

When I resize the dialog, the tab widget and frame resize as expected, but the widget within the frame does not.

What is the best way to get the widget that is inside the frame to resize along with the frame?

Thank you,
Chas

ChasW
11th February 2007, 07:47
Actually, the widget within the frame is resizing with the frame.

What i didnt realize is that a maximize event was not a resizeEvent, so my test was invalid.

So what I am trying to do now is catch a maximize event so I can handle it.

I am trying this, but it doesnt seem to be working.


void COutput::changeEvent(QEvent* event)
{
switch (event->type())
{
case QEvent::WindowStateChange:
{
qDebug() << "state change";
}
default:
QWidget::changeEvent(event);
}
}

What am I doing wrong here?

p.s. thenagain, I am probably wrong to think I can catch such a window event within a widget.. which leaves me in somewhat of a quandry...

jpn
11th February 2007, 09:55
When I resize the dialog, the tab widget and frame resize as expected, but the widget within the frame does not.

What is the best way to get the widget that is inside the frame to resize along with the frame?
Add the widget inside the frame into a layout and install the layout on the frame.

wysota
11th February 2007, 19:21
Maximize is only relevant with top level widgets and honestly I don't see how would maximising a child widget work...