Disable click for 3-5 minute
-
Hi and welcome to devnet,
That's what QProgressDialog is usually used for. You can remove the cancel button from it too.
-
I want to disable click for whole application while receiving data from serial connection. I want to print information on the screen with a message box and turn off clicking for a certain time, how can I do it?
@mangekoyu
Quite untested, but if yousetDisabled(true)
on your very top-level widget(s) doesn't that disable all its descendant widgets so that none of them will accept any input?Otherwise you might look at installing a top-level
eventFilter()
on the entire application as per https://doc.qt.io/qt-6/eventsandfilters.html#event-filtersIt is also possible to filter all events for the entire application, by installing an event filter on the QApplication or QCoreApplication object. Such global event filters are called before the object-specific filters.
and have it ignore events during your period.
Note that this "complete disablement" may not be the ideal way to handle the situation. But that is what you asked for.
-
Hi and welcome to devnet,
That's what QProgressDialog is usually used for. You can remove the cancel button from it too.
-
You should not connect it to the serial port itself. Have a controller class that manages the serial port communication and that will generate start and end signals or a progress signal that you will use to manage your progress dialog.
-
To add to @SGaist: If you don't know the percentage you can just put in the range (0,0). This will just be an indicator that your software is doing something. The key point is that the progress dialog is modal and will thus block input to everything else but itself.