Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.1
-
None
-
Ubuntu 12.10 64bit
-
3d5ffa7102e3373942a6b889386bc77a9c957be0
Description
I think it would be easier to explain on the example:
import QtQuick 2.0 Rectangle { width: 100 height: 400 color: "#808080" Column { anchors.fill: parent Rectangle { width: 100; height: 100 color: Positioner.isFirstItem ? "red" : (Positioner.isLastItem ? "blue" : "green") border.width: 1 border.color: "black" } Rectangle { width: 100; height: 100 color: Positioner.isFirstItem ? "red" : (Positioner.isLastItem ? "blue" : "green") border.width: 1 border.color: "black" } Rectangle { width: 100; height: 100 color: Positioner.isFirstItem ? "red" : (Positioner.isLastItem ? "blue" : "green") border.width: 1 border.color: "black" } Rectangle { width: 100; height: 100 color: Positioner.isFirstItem ? "red" : (Positioner.isLastItem ? "blue" : "green") border.width: 1 border.color: "black" visible: !mouseArea.pressed } } MouseArea { id: mouseArea anchors.fill: parent } }
This code works simply: we have a column of 4 rectangles. The color of rectangle depends on its position in the column - the blue one is the last one. On press we hide the last item, so there is the new last item (the third one from top) and it correctly becomes blue. When we release the button, then the fourth item is shown again and it is correctly blue, but the third item, which is not last anymore remains blue as it's Positioner.isLastItem reamins true. So there are 2 items which are last at the same time - which is obviously not correct.