Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, October 2007
Re: Solved [was: Sizepolicy and stuff]


Message 1 in thread

Hi,
why don't you put sub_mdi widget in a layout?

Benjamin Hopfer a écrit :

> Benjamin Hopfer schrieb:
>
>> I have a MDI-Application with QDockWidgets.
>>
>> I want the central MdiSubWindows content to fit to the remaining 
>> space that is left by the QDockWidgets. So if I resize a QDockWidget 
>> I want to resize the child of the MdiSubWindows.
>>
>> My current "Widget-Tree" is:
>>
>> MdiSubWindow
>>  |
>>  |-FirstOwnClassDerivedFromQWidget1
>
>
>             ^^^^^^Thats the problem^^^^^^
>
> Because I inherited this from QWidget, the QTabWidget gets no resize
> events.
>
>
>>     |
>>     |-QTabWidget
>>        |
>>        |-SecondOwnClassDerivedFromQWidget
>>           |
>>           |-ExternalWidgetDerivedFromQWidgetThatIHaveNoSourceCodeFor
>>
>
> The solution for me was to subclass FirstOwnClass... directly from 
> QTabWidget.
>
> A final question just for understanding: What would I need to do, to 
> make a QWidget stretch inside another one to full space?
>
> So if the following was the current code (background of inner QWidget 
> set to blue to see its size):
>
> 8<-------------------------------------------------
> QWidget *mdi_content = new QWidget();
>
>   QWidget *sub_mdi = new QWidget(mdi_content);
>   sub_mdi->setBackgroundRole(QPalette::Highlight);
>   sub_mdi->setAutoFillBackground(true);
>
>   mdi_content->show();
> ------------------------------------------------>8
>
> What to add, If i want the inner (blue) QWidget to fit the full space 
> of the parent widget? I guess something with sizePolicy and sizeHint, 
> but I couldn't figure out...
>
> Greets
> Benjamin
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ]