Hello,
Stumbled again into binding loop
and asking for help
1) how to track down the loops on my own?
2) how to solve particular problem (below)?
Context: Screen is filled with ListItems which can be manipulated by
ContextMenu.
When held on last item on screen it would open submenu below screen,
but it is accommodated by changing contentY which:
* causes binding loop warnings
* but visually it actually works ok by scrolling screen
I prefer to write code without warnings.
Included minimal code below.
I consider myself quite new here
and havent seen much Silica talk here...
Is it appropriate place for Silica related questions?
Ragnar
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
SilicaListView { // QML SilicaListView: Binding loop detected for
property "contentY"
anchors.fill: parent // prevent "Binding loop" type 1
model: ListModel {
id: model
Component.onCompleted: {
for (var i=0 ; i<12 ; i++) model.append({"i": i});
}
}
delegate: ListItem {
menu: ContextMenu { MenuItem { text: "Delete?" } } // hold
on last item on screen to open the menu
Label { text: i }
}
}
}
_______________________________________________
SailfishOS.org Devel mailing list