QMessageBox blocks QDialog

I really don't know how to formulate my question this time ...

I have an application with QDialog as the main window. The application receives various values, such as temperature, humidity, etc. From a remote machine.

For development, I added a group with various widgets to simulate these values. I have different restrictions in order to cause warnings and alarms to the user.

For example, if the temperature rises by more than 30 ° C, I open the QMessageBox with a request (the application does a poll on a remote machine) and the current temperature. Thus, this is an update of each request cycle.

I use the show () method to open a message box in which my application runs in the background. Now the problem is this: the focus is in the message box, and nothing in my main window / QDialog can be pressed until the message box is accepted / completed.

And what is my problem: in simulation mode I want to play with different temperature values, which I can set using the slider in the main window. How can I access these widgets / make the message box "non-blocking"?

Yours faithfully,

Matthias

+2
source share
2 answers

, , "" . a QMessageBox " ". , .

, setWindowModality() Qt:: WindowModality, show(). :

box->setWindowModality(Qt::NonModal);
box->show();
+8

, , QMessageBox, ui , , ( ) , .

, Qt:: NonModal ( , , ), ui, . , "". , - , , - ? ? - .

, , , , , .

, , , - , , , / , QMessageBox.

,

0

Source: https://habr.com/ru/post/1535945/


All Articles