Last active
April 28, 2017 12:42
-
-
Save PoisonousJohn/c6db35362a774acd34152316188399dd to your computer and use it in GitHub Desktop.
Causing a crash on qt 5.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.7 | |
import QtQuick.Controls 2.0 | |
import QtQuick.Layouts 1.0 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 | |
title: qsTr("Hello World") | |
ListModel { | |
id: testModel | |
Component.onCompleted: { | |
testModel.append( | |
{ | |
"key" : "click me to test", | |
"nested" : { "anotherObjKey": "test" } // this line causes a crash | |
} | |
); | |
} | |
} | |
ColumnLayout { | |
width: 100 | |
Repeater { | |
model: testModel | |
delegate: Rectangle { | |
width: 200 | |
height: 50 | |
color: "#eee" | |
Text { | |
anchors.centerIn: parent | |
text: testModel.get(index).key | |
} | |
MouseArea { | |
anchors.fill: parent | |
onClicked: { | |
testModel.remove(0); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment