I want to improve the paintevent speed of modal window
-
Hi
I update the screen through paintevent of modal window every 10 seconds.
If there are many GUI elements in the parent window(Ex. chart data), the modal window updated every 10 seconds is delayed to 100 seconds.
I want to improve the paintevent speed of modal window
Does paintevent in modal window also redraw the gui in parent window?
My modal window has transparency property.
Thank you for reading my poor English. -
For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.
The transparency will also require work since the layer underneath is being modified.
You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.
It will also depend on how you are feeding the data to the model.
-
Hi,
Are you doing custom painting ?
What is happening in that dialog of yours ?
What happens to the main application while you are showing that dialog ? -
Hi,
Are you doing custom painting ?
What is happening in that dialog of yours ?
What happens to the main application while you are showing that dialog ?@SGaist Hi!
The main application has charts and grids.
The Modal window does the job of displaying an indeterminate progress bar.In my Modal window, QTimer calls update every 10 ms (not 10 sec).
update automatically calls the overridden paintevent.I did the test.
[Modal window]
In the paintevent function, there is only one line of code that prints the time.
QDateTime::currentDateTime().Tostring("mm:ss.zzz")[Main window]
Open the Modal window and add series and data to the chart.
When data addition is completed, the modal window is closed.[1] When there is no or little data in the chart, the time value of paintevent in the modal window is approximately 10ms interval.
[2] When there are a lot of series and data in the chart, the time value of paintevent in the modal window is approximately 100ms
What causes the speed difference?
Is it because the graphic elements of the main window behind the Model window are also redrawn?
I know that graphic elements can be processed only in the main thread.
Can't it be split into a different thread?In case of [2], progress is slow.
I always want the progress to run at the same speed.
Any good ideas? -
For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.
The transparency will also require work since the layer underneath is being modified.
You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.
It will also depend on how you are feeding the data to the model.
-
For starters: don't update your progress information hundreds of time per second, it adds no valuable information that fast and just burn CPUs.
The transparency will also require work since the layer underneath is being modified.
You can also make the update to the widgets below smarter by either handling data per batch rather than continuously, block their updates while the data is being loaded or a mix of both.
It will also depend on how you are feeding the data to the model.