How do I create a modeless message box?
-
I want to create a modeless message box.
There are no buttons or progress bars to display, only messages.
I would also like the system to terminate when the work is completed or when it fails.Is it possible to create such a message box?
@Knj-Tkm said in How do I create a modeless message box?:
Is it possible to create such a message box?
Yes. Solution depends on whether we are talking about QtWidgets or QtQuick, but in general:
- make a custom dialog, without buttons
- set it to be application modal
- reimplement close event to prevent users from closing the dialog with Alt+F4
I would also like the system to terminate when the work is completed or when it fails.
Solution depends on the operating system, but in general you need to use
QProcess::startDetachedand run system command to shut down or reboot the device. -
@Knj-Tkm said in How do I create a modeless message box?:
Is it possible to create such a message box?
Yes. Solution depends on whether we are talking about QtWidgets or QtQuick, but in general:
- make a custom dialog, without buttons
- set it to be application modal
- reimplement close event to prevent users from closing the dialog with Alt+F4
I would also like the system to terminate when the work is completed or when it fails.
Solution depends on the operating system, but in general you need to use
QProcess::startDetachedand run system command to shut down or reboot the device.@sierdzio said in How do I create a modeless message box?:
set it to be application modal
How does this address OP's request for a modeless message box? Seems to me to be the opposite. Why not a modeless one?
setModal(false), useshow()instead ofexec()? -
@sierdzio said in How do I create a modeless message box?:
set it to be application modal
How does this address OP's request for a modeless message box? Seems to me to be the opposite. Why not a modeless one?
setModal(false), useshow()instead ofexec()?