summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
diff options
context:
space:
mode:
authorJan-Arve Saether <jan-arve.saether@nokia.com>2011-06-09 07:57:39 (GMT)
committerJan-Arve Saether <jan-arve.saether@nokia.com>2011-06-10 06:25:59 (GMT)
commit4225a25efb46c9f5a3fbb8197286663b8cb21e27 (patch)
tree101e6b16cec0998ffafc0f5e89ebc20527588b18 /src/gui/graphicsview/qgraphicsitem_p.h
parent575e832fd053df98e60aefebbc5843a4864f2523 (diff)
downloadQt-4225a25efb46c9f5a3fbb8197286663b8cb21e27.zip
Qt-4225a25efb46c9f5a3fbb8197286663b8cb21e27.tar.gz
Qt-4225a25efb46c9f5a3fbb8197286663b8cb21e27.tar.bz2
Fixes to how resize event and layout request are posted.
Also fixed how the relayout is initiated. This is because we needed to react differently to *posted* layout requests than to sent layout requests. (sent ones should activate the layout, posted ones should also resize the widget). We therefore introduced the private slot _q_relayout() in order to be able to make the distinction between posted and sent layout requests. (Instead of posting we now invokeMethod with a queued connection. In order to make it behave as it was compressed we also have to refcount the number of calls to invokeMethod.) (Note that refCount is 16 bits only, so it should not overflow in sane cases. In the insane cases, the worst thing that will happen is that it'll relayout the layout one extra time). Make sure we resize QGraphicsWidget to be within its min,max sizes when we change one of its constraints. (e.g. we change minimumSize to something bigger than the current size). This did not work if the widget did not have a layout. Send a resize event whenever a QGraphicsWidget changes its size. This did not happen before, because in the cases where a Layout Request was sent, we did not send a resize event. This patch changes that, so that when we send a resize event, we do not send a Layout Request event. This means that a Layout Request event is now *only* sent in order to tell a widget to relayout its children (but the widgets size was not changed, that's why we cannot send a resize event in that case) Also includes a unit test, and a fix to make sure that we send a resize event when we resize due to the sizehint changing followed by a setPos command. Added autotests for this. (and changed some) Many thanks to John Tapsell and Stanislav Ionascu for help. (autotests were provided by them). My poor explanation did not convince Frederik 100%, but he is "convinced enough" :) Reviewed-by: Frederik Gladhorn
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem_p.h')
0 files changed, 0 insertions, 0 deletions