Avoid styling during paint on Qt

17 views
Skip to first unread message

Neil

unread,
Jul 25, 2026, 7:38:49 PM (11 days ago) Jul 25
to scintilla-interest
The other 3 included platforms try to perform styling before receiving paint events so that paints do not attempt to work on incomplete style information. The QueueIdleWork virtual method allows platform layers to schedule styling although each platform does this a bit differently.

The Qt platform layer does not currently implement QueueIdleWork so may have to perform styling inside paint. If this changes styles outside the paint area, it can cause that paint to be abandoned and a whole window repaint scheduled. This is inefficient and could lead to visual hitches.

Attached is a proposal for implementing QueueIdleWork on Qt as a custom event 'workEvent'. The implementation is closest to the Win32 platform layer, posting a single event to the application event queue where it will be processed asynchronously but before the next paint. There is a 'workInQueue' flag to prevent flooding the queue with  workEvent events. It currently uses the default priority but this could change if necessary.

Neil

workEvent3.patch

Neil Hodgson

unread,
Jul 28, 2026, 9:00:10 PM (8 days ago) Jul 28
to scintilla...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages