我有以下代码:
import QtQuick 2.0
import QtCharts 2.0
...
ChartView {
id: testChart
title: "Chart"
width: parent.width
height: parent.height / 3
legend.visible: true
legend.alignment: Qt.AlignRight
legend.font.pixelSize: ScreenModel.dp(10)
legend.font.bold: true
antialiasing: true
...
}
如果我在iPhone模拟器上运行此代码,它可以正常工作,但是当我在真正的iPhone 4S上运行它时,它会崩溃并显示以下日志:
qrc:/platform/common/qml/main.qml:461类型TestPage不可用 qrc:/platform/common/qml/page/TestPage.qml:727无效的分组 财产访问
在QList :: at中的ASSERT失败:"索引超出范围",文件 ../../include/QtCore/../../src/corelib/tools/qlist.h,第478行计划 收到信号6, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:00000000; 04:06000000; 05:dc296e36; 06:e8260b03; 07:fc441303; 08:00000000; 09:dc296e36; 0A: a83a5514; 0B:47420f00; 0C:48010000; 0D:f0441303; 0E:97ecee33; 0F:f0dde633; 10:千万; metype:5; mecount:2; medata:10003; medata:6; 节目收到信号6, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:FFFFFFFF; 04:06000000; 05:dc296e36; 06:e8260b03; 07:dc441303; 08:00000000; 09:7990ee33; 0A: a83a5514; 0B:47420f00; 0C:48010000; 0D:d0441303; 0E:97ecee33; 0F:f0dde633; 10:千万; metype:5; mecount:2; medata:10003; medata:6; 节目收到信号5, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:01000000; 04:ec441303; 05:FFFFFFFF; 06:e8260b03; 07:fc441303; 08:00000000; 09:7990ee33; 0A: a83a5514; 0B:47420f00; 0C:30000000; 0D:e4441303; 0E:abc9e033; 0F:aac9e033; 10:30000040; metype:6; mecount:2; medata:1; medata:防卫厅; 节目收到信号5, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:01000000; 04:ec441303; 05:FFFFFFFF; 06:e8260b03; 07:fc441303; 08:00000000; 09:7990ee33; 0A: a83a5514; 0B:47420f00; 0C:30000000; 0D:e4441303; 0E:abc9e033; 0F:aac9e033; 10:30000040; metype:6; mecount:2; medata:1; medata:防卫厅; 节目收到信号5, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:01000000; 04:ec441303; 05:FFFFFFFF; 06:e8260b03; 07:fc441303; 08:00000000; 09:7990ee33; 0A: a83a5514; 0B:47420f00; 0C:30000000; 0D:e4441303; 0E:abc9e033; 0F:aac9e033; 10:30000040; metype:6; mecount:2; medata:1; medata:防卫厅; 节目收到信号5, 螺纹:321e1; qaddr:366e2ad0; 00:00000000; 01:00000000; 02:00000000; 03:01000000; 04:ec441303; 05:FFFFFFFF; 06:e8260b03; 07:fc441303; 08:00000000; 09:7990ee33; 0A: a83a5514; 0B:47420f00; 0C:30000000; 0D:e4441303; 0E:abc9e033; 0F:aac9e033; 10:30000040; metype:6; mecount:2; medata:1; medata:防卫厅; 达到最大连续信号数,停止运行结束。
其中
TestPage.qml:727
是legend.visible
为什么此代码在模拟器中有效但在真实设备上失败?