Important: Please read the Qt Code of Conduct -

Segmentation fault when using properties in QML

  • Hello,

    I'm using properties in my QMLs, which uses items in this QML with The properties are set by an JS, because I'm creating instances of this in runtime.
    In this example the property mainvalue is set by the JS. This code works well on windows, which is my platform where I develop. On my target platform, raspberry with rasbian, it causes a segmentation fault.

    property double mainvalue
            Gauge {
                id: vertgauge
                height: parent.height - 50
                width: parent.width * 0.1
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 10
                anchors.left: parent.left
                anchors.leftMargin: 10
                orientation: Qt.Vertical
                tickmarkStepSize : 0
                minorTickmarkCount: 0
                tickmarkAlignment: Qt.AlignRight
                value: parent.mainvalue
                //maximumValue: parent.maxvalue
                style: GaugeStyle {
                    valueBar: Rectangle {
                        implicitWidth: 25
                        color: "#9f9f9f"

  • Moderators

    how do you know that this assignment causes the crash?! Normally this just causes a runtime error, but no crash.
    Unless there is some custom type involved and it's property getter/setter has a bug in the C++ implementation.

Log in to reply