Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Smooth repaint

$
0
0
Hi! I have elemens hierarchy like this: RootItem.qml     import QtQuick 2.0       Flickable {         id: flickable         anchors.fill: parent         contentHeight: content.height         contentWidth: content.width           visibleArea.onYPositionChanged:  item2.internalY = flickable.mapToItem( item2, 0, 20 ).y           Item {             id: content             height:  800             width: 300             Column {                 anchors.fill: parent                 Level2 {                     id: item2                     anchors { left: parent.left; right: parent.right }                 }             }         }     } Level2.qml import QtQuick 2.0   Rectangle {     height: 800       property int internalY: 0       Level3 {         anchors.fill: parent         internalY: parent.internalY + 5     } } Level3.qml import QtQuick 2.0   Item {     property int internalY: 0       Rectangle {         id: internal         height: 20         width: 20         anchors { right: parent.right }           y: internalY + 5     } } Objective – positioning “internal” element relative to “flickable”. In the example above all works fine. But in real project (with a large number of elements) on scrolling the “internal” element doesn’t move smoothly. I think this is because the values ​​of properties are set through the event queue. If change all property (“internalY”) to alias it is solve the problem. But moving all logic in root element – it’s bad idea. Is there another solution?

Viewing all articles
Browse latest Browse all 4972

Trending Articles