Change cursor to hourglass/wait/busy cursor and back in Qt

后端 未结 2 1765
[愿得一人]
[愿得一人] 2021-02-05 00:37

I spawn a process that performs a lengthy operation, and I\'d like to give visual feedback that something is happening, so I want to change the cursor to busy and restore it whe

2条回答
  •  清歌不尽
    2021-02-05 00:45

    Use this to set the cursor to wait when the process begins:

    this->setCursor(Qt::WaitCursor);
    

    And this to restore the cursor back to normal (put this in the slot for QProcess::finished)

    this->setCursor(Qt::ArrowCursor);
    

提交回复
热议问题