Skip to content
Snippets Groups Projects
Commit 47c9ac5c authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

use Loader to destroy the victim button, which seems more realistic

parent 4f1181c2
Branches master
No related tags found
No related merge requests found
...@@ -14,14 +14,17 @@ Window { ...@@ -14,14 +14,17 @@ Window {
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
Button { Loader {
id: button id: buttonLoader
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
active: true
sourceComponent: Button {
text: "Greeting to crash" text: "Greeting to crash"
onClicked: { onClicked: {
serviceObject.greeting(); serviceObject.greeting();
} }
} }
}
Button { Button {
id: timerButton id: timerButton
...@@ -36,7 +39,7 @@ Window { ...@@ -36,7 +39,7 @@ Window {
interval: 5000 interval: 5000
onTriggered: { onTriggered: {
console.log("triggered"); console.log("triggered");
button.destroy(); buttonLoader.active = false;
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment