Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
9d6ccfea89ae99b747f70ece71185868f189d0f9
Description
Creating new content inside Flickable using createObject() doesn't make it part of the "flickable" content. Instead the newly created item stays still while rest of the flickable content moves. Confirmed with current Qt 4.7 gitorious upstream.
Small example code:
—
// dynamic_flickable.qml
import Qt 4.7
Flickable {
id: myFlickable
width: 400; height: 400
contentWidth: 600; contentHeight: 600
Rectangle {
id: rect
x:100; y:100
width: 200; height: 200
color: "blue"
MouseArea {
anchors.fill: parent
onClicked:
}
}
}
—
// Box.qml
import Qt 4.7
Rectangle {
color: "red"
width: 100
height: 100
}
—
Outcome: Clicking the blue rectangle creates a red rectangle. When flicking, blue rectangle moves as expected, but red stays in top-left corner.
Workaround: The workaround I used now is to create extra Item inside Flickable which takes all the content and then with createObject() create new content to be inside this item instead the flickable.