Support resetting with button
This commit is contained in:
parent
18b6e69e9f
commit
def77613c6
1 changed files with 9 additions and 3 deletions
12
qml/Main.qml
12
qml/Main.qml
|
@ -51,10 +51,16 @@ ApplicationWindow {
|
|||
}
|
||||
|
||||
Button {
|
||||
text: "Pause"
|
||||
text: factorizationController.isPaused ? "Reset" : factorizationController.isRunning ? "Pause" : "Reset"
|
||||
Layout.fillWidth: true
|
||||
enabled: factorizationController.isRunning
|
||||
onClicked: factorizationController.stop()
|
||||
enabled: factorizationController.isRunning || factorizationController.isPaused
|
||||
onClicked: {
|
||||
if (factorizationController.isPaused) {
|
||||
factorizationController.reset();
|
||||
} else {
|
||||
factorizationController.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue