Problem Description
When dynamically loading SCXML state machines in a program, the GammaRay program crashes. I've created a simple example program to reproduce this issue, and here are the details:
Steps to Reproduce
- Code Structure
- Add a button to the
main interface.
- The click event of the button increases the number of items in the
model.
- Use the
Repeater component to load as many newview instances as the number of items in the model.
- In the
newview, load a state machine from an SCXML file.
Here are the key parts of the example code:
main.qml
import QtQuick 2.15
import QtQuick.Window 2.15
Window {
visible: true
width: 640
height: 480
title: "Dynamic SCXML Loading Bug"
// Define a ListModel as the data model
ListModel {
id: myModel
}
// Button to increase the number of items in the model
Button {
id: addButton
text: "Add Item"
anchors.centerIn: parent
onClicked: {
myModel.append({})
}
}
// Repeater to load newview instances
Repeater {
model: myModel
NewView {
// Add other properties as needed
}
}
}
NewView.qml
import QtQuick 2.15
import QtScxml 5.15
Item {
width: 100
height: 100
// Load the SCXML state machine
ScxmlStateMachine {
id: stateMachine
source: "myStateMachine.scxml"
running: true
}
}
myStateMachine.scxml
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
initial="idle">
<state id="idle">
<transition event="start" target="active"/>
</state>
<state id="active">
<transition event="stop" target="idle"/>
</state>
</scxml>
- Operation Steps
- Start the program and make sure GammaRay is connected to it.
- Click the button in the
main interface to increase the number of items in the model.
- As the
Repeater loads new newview instances and dynamically loads the SCXML state machines, the program crashes.
Expected Result
When clicking the button to increase the number of items in the model, the program should run normally. The dynamically loaded SCXML state machines should work properly without causing the GammaRay program to crash.
Actual Result
Every time the button is clicked to dynamically load SCXML state machines, the GammaRay program crashes.
Problem Description
When dynamically loading SCXML state machines in a program, the GammaRay program crashes. I've created a simple example program to reproduce this issue, and here are the details:
Steps to Reproduce
maininterface.model.Repeatercomponent to load as manynewviewinstances as the number of items in themodel.newview, load a state machine from an SCXML file.Here are the key parts of the example code:
main.qml
NewView.qml
myStateMachine.scxml
maininterface to increase the number of items in themodel.Repeaterloads newnewviewinstances and dynamically loads the SCXML state machines, the program crashes.Expected Result
When clicking the button to increase the number of items in the
model, the program should run normally. The dynamically loaded SCXML state machines should work properly without causing the GammaRay program to crash.Actual Result
Every time the button is clicked to dynamically load SCXML state machines, the GammaRay program crashes.