Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 280634 - [PATCH] >=dev-python/PyQt4-4.5: fix QGraphicsLinearLayout gfx glitches with children elements
Summary: [PATCH] >=dev-python/PyQt4-4.5: fix QGraphicsLinearLayout gfx glitches with c...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-07 10:12 UTC by Fabio Erculiani (RETIRED)
Modified: 2009-08-12 08:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
QGraphicsLinearLayout children widgets patch (PyQt4-4.5.1-qgraphicslinearlayout-fix.patch,572 bytes, patch)
2009-08-07 10:13 UTC, Fabio Erculiani (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Erculiani (RETIRED) gentoo-dev 2009-08-07 10:12:59 UTC
Removing items from a QGraphicsLinearLayout works in a way that may seem
counterintuitive to many: when using the removeAt() or removeItem()
methods, the item is removed from the layout, but it is not removed
from the scene. This means that the item will still be shown, though
its size and position won't be managed by the layout anymore.

For the same reason, the item won't be removed from the list of its
parent's children.

# This won't actually make the item disappear
layout.removeAt(2)

However, if we get a reference to the item using itemAt() and we
assign it to a variable, the removal will have a different behavior.
The item is actually removed from the list of children of its parent.

# This will remove the item from the layout and make it disappear
w = layout.itemAt(2)
layout.removeAt(2)

Warning: the detachment from the parent happens when control goes back
to the loop, not before that.

To make a long story short, due to this PyQt4 bug, doing:

w = layout.itemAt(2)
layout.removeAt(2)

is the same of:

layout.removeAt(2)
del layout.itemAt(2)

that equals to:

del layout.itemAt(2)


The attached patch fixes the issue.

Reproducible: Always
Comment 1 Fabio Erculiani (RETIRED) gentoo-dev 2009-08-07 10:13:32 UTC
Created attachment 200481 [details, diff]
QGraphicsLinearLayout children widgets patch
Comment 2 Davide Pesavento (RETIRED) gentoo-dev 2009-08-07 12:23:27 UTC
Have you reported the issue upstream?
Comment 3 Fabio Erculiani (RETIRED) gentoo-dev 2009-08-07 12:25:53 UTC
I always do, but never gotten a single answer.
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2009-08-07 16:36:15 UTC
(In reply to comment #3)
> I always do, but never gotten a single answer.
> 

Phil always responds to my e-mails

I use this e-mail phil[at]riverbankcomputing.com to contact him
Comment 5 Fabio Erculiani (RETIRED) gentoo-dev 2009-08-11 12:11:43 UTC
Just mailed Phil pointing him to this bug ;)
Thanks a lot
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2009-08-12 08:57:36 UTC
Patch applied on latest PyQt4 snapshot by upstream

I applied this patch on PyQt4-4.5.4-r3 as well

Thanks Fabio

+*PyQt4-4.5.4-r3 (12 Aug 2009)
+
+  12 Aug 2009; Markos Chandras <hwoarang@gentoo.org> -PyQt4-4.5.4-r1.ebuild,
+  +PyQt4-4.5.4-r3.ebuild,
+  +files/PyQt4-4.5.4-qgraphicslinearlayout-fix.patch:
+  Added patch for removing items from QGraphicsLinearLayout. Fixes bug
+  280634 .
+  THanks to Fabio Erculiani <lxnay@sabayonlinux.org> for the patch
+