[英]QML ListView : “complex” delegate causes crash
我的应用程序出现问题时,我已经在网上搜索了一些东西(甚至是远程的),并且发现了这一点: 从QAbstractListModel (答案中提供的代码)中删除行 -效果很好! 但是,当我将ListView
委托更改为更“复杂”的东西时,如下所示:
Component {
id: commonDelegate
Rectangle {
width: view.width
implicitHeight: editor.implicitHeight + 10
color: "transparent"
border.color: "red"
border.width: 2
radius: 5
TextInput {
id: editor
anchors.margins: 1.5 * parent.border.width
anchors.left: parent.left
text: edit.name // "edit" role of the model, to break the binding loop
onTextChanged: {
display.name = text;
model.display = display
}
}
ComboBox {
id: siema
anchors.left: editor.right
model: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "+"]
}
Button {
id: bt
text: "Guizk"
anchors.left: siema.right
anchors.right: parent.right
}
}
}
然后在添加一些行(试图填充整个屏幕,使其中一些不可见)并尝试滚动到那些不可见的行后,应用程序崩溃。 使用调试器运行时,报告的错误为EXC_BAD_ACCESS
并且在Creator中显示了针对功能QCoreApplication :: proccessEvents的反汇编。
委托人的“复杂程度”是否有限制? 还是有一种更好(更有效)的方法来避免崩溃?
该崩溃发生在Windows 7 64位,OsX 10.8.5和Android 4.1上
如果您需要更多信息,请与我们联系。
通过反复试验,我遇到了同样的问题,即Combobox对崩溃负责。
如果您可以没有它,请尽量不要使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.