Skip to content

SIGSEGV when changing state property on QML object #84

@sountharcs

Description

@sountharcs

i have created qml file with qt creator and it works very well when i run with QtCreator.But it does not run when i use the same qml file with Go.
i am getting error like this :
SIGSEGV: segmentation violation
PC=0xb65dc472
signal arrived during cgo execution
Its crashing while i move one rectangle to another rectangle's position. Most of the tutorials are working well even gopher example is working well.
i attached you an example. its working well. But if i use rect1.x and rect1.y instead of 50 & 160 its crashing. So the problem is here.
working case :

states: State {
        name: "down";
        PropertyChanges { target: rect1; x:50; y: 160}
    }
crashing :
states: State {
        name: "down";
        PropertyChanges { target: rect1; x:rect2.x; y: rect2.y}
    }


Complete code :


import QtQuick 2.0
Rectangle {
    id: page
    width: 320; height: 480
    color: "lightgray"
    state:"none"
    Rectangle {
        id: rect1
        x: 30
        y: 30
        width:50
        height:50
        MouseArea {
            anchors.fill: parent
            onClicked: page.state = 'down'
        }
    }
    Rectangle {
        id: rect2
        x: 50
        y: 160
        width:50
        height:50
    }
    states: State {
        name: "down";
        PropertyChanges { target: rect1; x:50; y: 160} // if i use rect2.x and rect2.y instead of 50 & 160 its crashing...
    }
    transitions: Transition {
        from: "none"; to: "down";
        NumberAnimation { properties: "x,y"; duration: 2000; easing.type: Easing.InOutQuad }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions