title: How to prevent QML button multiple click in a short period?
body: <p>I hava a QML button, and I want to prevent the button to be clicked before my function call is finished.</p>
  <p>I tried the code below and it's not working. Button does not toggle enabled/disabled within the <code>clicked</code> signal. I guess the binding does not take effect immediately.</p>
  <pre><code>import QtQuick
  import QtQuick.Control
  
  Button {
      onClicked: {
          console.log('clicked')
          this.enabled = false
          do_something()
          this.enabled = true
      }
  }
  </code></pre>
  <p>I also tried <code>pressed</code> signal</p>
  <pre><code>Button {
      onPressed: {
          console.log('pressed')
          this.enabled = false
      }
      onClicked: {
          console.log('clicked')
          do_something()
          this.enabled = true
      }
  }
  </code></pre>
  <p>But the <code>onClicked</code> signal is not triggered at all.</p>