Hi Qt Masters,
I am having error polish() loop in iOS when binding image source using repeater.
However no such error appeared when building it in Android.
When I tried debugging (putting logs), found out that the repeater populates the image row twice then loop error, which made me conclude that the error is due to repeater population.
I can't find any error in the code which triggers the display of the image row twice or more.
Is there a way to limit the repeater to populate only once on first display?
Except when there is mouse interaction because new image source will be displayed.
Thanks in advance.
Item
{
id: root
property int currLevel: 1
property bool disabled: currLevel <= 0
Layout.fillWidth: true
implicitHeight: row.implicitHeight
implicitWidth: row.implicitWidth
Row {
id: row
anchors.fill: parent
Repeater
{
id:repeater
model: 10
Image {
id: img
function urlForState(disabled, hover, active) {
if(disabled && active) return "img-disabled.png"
if(disabled) return "img-off.png"
if (active) {
if (hover) return "img-on-over.png"
return "img-on.png"
} else {
if (hover) return "img-off-over.png"
return "img-off.png"
}
}
width: row.width/model
fillMode: Image.PreserveAspectFit
source: urlForState(root.disabled, mouseArea.pressed, root.currLevel > index)
}
}
}
MouseArea
{
id: mouseArea
anchors.fill: parent
hoverEnabled: true
}
}
Item
{
id: root
property int currLevel: 1
property bool disabled: currLevel <= 0
Layout.fillWidth: true
implicitHeight: row.implicitHeight
implicitWidth: row.implicitWidth
Row {
id: row
anchors.fill: parent
Repeater
{
id:repeater
model: 10
Image {
id: img
function urlForState(disabled, hover, active) {
if(disabled && active) return "img-disabled.png"
if(disabled) return "img-off.png"
if (active) {
if (hover) return "img-on-over.png"
return "img-on.png"
} else {
if (hover) return "img-off-over.png"
return "img-off.png"
}
}
width: row.width/model
fillMode: Image.PreserveAspectFit
source: urlForState(root.disabled, mouseArea.pressed, root.currLevel > index)
}
}
}
MouseArea
{
id: mouseArea
anchors.fill: parent
hoverEnabled: true
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks