Link to home
Start Free TrialLog in
Avatar of Ingo Foerster
Ingo Foerster

asked on

QListWidget flickering

hi,

currently I have a QListWidget that I fill with items. This items are log lines from software. But QListWidget flickers like hell if many data arrives. Sometimes it leave blank sometimes it show something. Any idea how to optimize this?

Ingo
Avatar of trinitrotoluene
trinitrotoluene
Flag of Australia image

why don't you have a caching strategy rather than load in real time? pre-fetch and then display as opposed to doing both at the same time.

Else create a separate thread for the load and let your GUI run in a separate thread. Fire an event when the data load completes and then let your GUI thread pick up the updates....
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ingo Foerster
Ingo Foerster

ASKER

@ trinitrotoluene
I always use an own thread to decouple. This cause the flickering. If I do not use the own thread the UI is freeze until the list filling is finished.
@sara
I will try your suggestion.
I always use an own thread to decouple. This cause the flickering.
the thread my not cause painting. instead it should fill a shared list (container) with the data and then send a message to the main thread that it should refill from list.

if the thread is the only one which writes to the list, you not even need a mutex. simply write to the container and signal end of writing by a message to the gui and end the thread. then the main thread may take responsibility.

Sara
I use now the function to add more than one item at the same time and it works better. Thanks for the hint.