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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
@sara
I will try your suggestion.
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
ASKER
I use now the function to add more than one item at the same time and it works better. Thanks for the hint.
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....