[Interest] QGridLayout does not update
Etienne Sandré-Chardonnal
etienne.sandre at m4x.org
Tue Mar 19 15:58:59 CET 2013
Ah, I think I got an idea from the docs.
Apparently, one cannot modify the layout of a widget after it has been set
as a QScrollArea content. Damned... this prevents me from dynamically
changing the content of the dock without recreating everything at each
update
Etienne
void QScrollArea::setWidget (
QWidget<qthelp://com.trolltech.qt.481/qdoc/qwidget.html>
* *widget* )
Sets the scroll area's *widget*.
The *widget* becomes a child of the scroll area, and will be destroyed when
the scroll area is deleted or when a new widget is set.
The widget's autoFillBackground<qthelp://com.trolltech.qt.481/qdoc/qwidget.html#autoFillBackground-prop>
property will be set to true.
If the scroll area is visible when the *widget* is added, you must
show()<qthelp://com.trolltech.qt.481/qdoc/qwidget.html#show>
it explicitly.
Note that You must add the layout of *widget* before you call this
function; if you add it later, the *widget* will not be visible -
regardless of when you
show()<qthelp://com.trolltech.qt.481/qdoc/qwidget.html#show>
the scroll area. In this case, you can also
notshow()<qthelp://com.trolltech.qt.481/qdoc/qwidget.html#show>
the *widget* later.
*See also *widget<qthelp://com.trolltech.qt.481/qdoc/qscrollarea.html#widget>
().
2013/3/19 Etienne Sandré-Chardonnal <etienne.sandre at m4x.org>
> Tried, with no success.
>
> Surprisingly, if I directly set my QWidget as the QDockWidget content, it
> works.
> But if I put a QScrollArea as the QDockWidget content, and my QWidget as
> QScrollArea content, it does not work.
>
> Something is wrong with the QScrollArea
>
> Etienne
>
>
> 2013/3/19 preeteesh kakkar <preeteesh.kakkar at gmail.com>
>
>> Try calling gridlayout->update() and see if that helps?
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130319/bab96038/attachment.html>
More information about the Interest
mailing list