Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ボタンが押されている限り、テキスト(数値)にリンクされ、その値を超えるボタンを作成する方法を知っている人はいますか?
私はこれを試しました:
Button { width:100 height:100 text: “up” onPressed: { ++myText.text; } } Text { id:myText text:1 }
ただし、これにより値が増加するのは一度だけです。
この仕事にはタイマーが必要です。
Item { Button { id:button1 width:100 height:100 text: “up” onPressed: { ++myText.text; } } Text { id:myText text:1 } Timer { interval: 500; running: button1.pressed ; repeat: true onTriggered: ++myText.text } }