There is a QList data; it reads the row id , data from the local database. Further, these lines are loaded into tableWidget . Each id can have any number of rows, and over the years the data will accumulate. So, if

 if (data.size > 1000) { // создавался какой-нибудь виджет или вызывался метод show(); }, 

and at the end of the cycle (as the data was loaded), it was hidden / deleted automatically.

Tried to do QMessageBox before the loop. QMessageBox itself was with a message and a show method, it was shown, but it was empty inside, without a message. And since the tableWidget filled in a loop, the widget itself was suspended for 10 seconds.

So, I want the widget to be stuck while the tableWidget loaded in tableWidget , a QMessageBox type widget is displayed with the message, and disappears / was deleted when the download was completed.

How can this be implemented?

  • for the display of boxing it is better to use similar constructions QMessageBox :: critica () // this displays errors, there is also informational and warning. And rpo your task may have to remove the output of the box to a separate stream, which will be killed after the download is completed. - Alex.B
  • it is possible and so, but maybe someone knows a different way. - Disastricks Sep.

3 answers 3

look towards QProgressDialog

    Option:

    • before loading create a timer object that will work, for example, in a second
    • hang on the timer triggering window output or what you need
    • when the download is finished, stop the timer and disconnect the slot in which the window is called

    So we get the output window, if the process runs longer, for example, seconds. And nothing will happen if the timer is removed in less than a second.

    • Something like this I did already, but thanks anyway. While I will not put a tick, maybe someone else wants to make their 5 cents in the subject. - Disastricks Sep.

    Try adding QApplication :: processEvents () after creating a QMessageBox so that it can be processed