Hi
I have an app which worked fine and after last update it is crashing, tested on Mac, iOS Simulator, Linux
I have narrowed the problem to ListModel which is updated in Component.onCompleted
Code is below, it crashed when I change Page1 to Page2 and it is fine when I comment out hourModel.append(data)
//Main.qml
import Felgo 3.0
import QtQuick 2.4
App {
// You get free licenseKeys from https://felgo.com/licenseKey
// With a licenseKey you can:
// * Publish your games & apps for the app stores
// * Remove the Felgo Splash Screen or set a custom one (available with the Pro Licenses)
// * Add plugins to monetize, analyze & improve your apps (available with the Pro Licenses)
//licenseKey: "<generate one from https://felgo.com/licenseKey>"
Navigation {
id:mainNavigation
anchors.fill: parent
visible: true
navigationMode: navigationModeDrawer
NavigationItem {
id:homeNaviItem
title: "Page1"
icon: IconType.home
NavigationStack {
id: progNaviStack
Page {
id: prog1Page
title: "page1"
}
}
}
NavigationItem {
id:sectionNaviItem
title: "Page2"
icon: IconType.home
NavigationStack {
id: sectionNaviStack
Page {
id:page
Rectangle {
id:innerRect
height: parent.height*0.7
width:parent.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
ListModel {
id: hourModel
}
CustomTumbler {
id:hourTumbler
anchors.left: parent.left
anchors.top:parent.top
anchors.bottom: parent.bottom
model: hourModel
width:parent.width/2
}
Component.onCompleted: {
for(var i=0;i<24;i++) {
var data = {'value': (i<10 ? "0"+i : ""+i)};
hourModel.append(data);
}
}
}
}
}
}
}
}
//CustomTumbler.qml
import QtQuick 2.9
import QtQuick.Controls 2.2
import Felgo 3.0
Tumbler {
id: customTumbler
implicitWidth: textItem.implicitWidth + leftPadding + rightPadding
implicitHeight: dp(100)
// hidden text for width calculation
AppText {
id: textItem
visible: false
text: processDelegateText ? processDelegateText(0) : 0
}
// styling
delegate: AppText {
text: processDelegateText ? processDelegateText(modelData) : modelData
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: "white"// blendColor("red", "white", 1 - Math.abs(Tumbler.displacement) / (visibleItemCount / 3))
opacity: 1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)
function blendColor(col1, col2, mix) {
var r = col1.r * (mix) + col2.r * (1 - mix)
var g = col1.g * (mix) + col2.g * (1 - mix)
var b = col1.b * (mix) + col2.b * (1 - mix)
return Qt.rgba(r, g, b, 1)
}
}
}
Best Regards
Marek