Auto close QMessageBox

前端 未结 5 2164
猫巷女王i
猫巷女王i 2020-12-31 19:20

I\'m building a Qt Symbian Project and I want to show a notification for the user that should auto close after some seconds. I have seen that Nokia uses this a lot in their

5条回答
  •  清酒与你
    2020-12-31 19:45

    I would suggest to subclass QMessageBox to add your own desired behavior...

    It would be interesting to add methods like setAutoClose(bool) and setAutoCloseTimeout(int) and trigger a QTimer on showEvent when the AutoClose option is enabled !

    This way, you could even alter the apparence of your QMessageBox and had a text saying "This box will close automatically in XXX seconds..." or a progress bar, etc...

提交回复
热议问题