[SailfishDevel] Seg fault with SilicaListView
Sylvain B.
sthocs at hotmail.com
Wed Dec 11 21:29:25 UTC 2013
Hello,
I am facing a Segmentation Fault with a SilicaListView.
I struggled a little to understand the cause but I finally managed to build a simple example which reproduces it.
What we need:
- A SilicaListView with a custom section: It works with a simple SectionHeader, but crashes when I use a Row (I'd like to put multiple components in it).
- A model with a certain amount of data:
- 10 sections with 2 items in each: OK
- 10 sections with 3 items in each: KO
- 15 sections with 2 items in each: KO
How to repro:
Start form the HelloSailors default example. Replace the content of FirstPage.qml by the code provided below.
Each item is clickable. Click on any of them to go to the second page. Come back. You will get:
bash: line 1: 13678 Segmentation fault DISPLAY=:0.0 /opt/sdk/HelloWorld/usr/bin/HelloWorld
Sometimes it works one time and crashes on the second attempt.
Thank you.
PS: I tried to run the app in debug mode but I just get a Dissasembler with hexa content. Is it possible to get a stacktrace?
--
Page {
id: page
SilicaListView {
id: listView
anchors.fill: parent
model: ListModel {}
header: PageHeader { title: "Buggy page" }
section {
property: 'category'
delegate: Row {
spacing: Theme.paddingMedium
height: Theme.itemSizeExtraSmall
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge
Label {
text: section
font.pixelSize: Theme.fontSizeSmall
color: Theme.highlightColor
}
}
// A simple SectionHeader works fine
// delegate: SectionHeader {
// text: section
// height: Theme.itemSizeSmall
// }
}
VerticalScrollDecorator {}
delegate: ListItem {
id: listItem
Column {
anchors.verticalCenter: parent.verticalCenter
Label {
id: mainText
x: Theme.paddingLarge
text: model.name
font.weight: Font.Bold
font.pixelSize: Theme.fontSizeSmall
}
Label {
id: subText
x: Theme.paddingLarge
text: model.subname
font.weight: Font.Light
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.secondaryColor
}
}
onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"));
}
Component.onCompleted: {
for (var i = 0; i < 30; ++i) {
model.append({ 'category': 'cat' + Math.floor(i / 2),
'name': 'name' + i,
'subname': 'subname' });
}
}
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131211/6310f79f/attachment.html>
More information about the Devel
mailing list