Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
22 May 2024
Have you ever wondered what the difference is between QWidget::repaint() and QWidget::update()? You may even have heard that update events collapsed into just one event in the event loop, which might make you ask the question on whether there are other events merged together. Let's debug into the Qt source code to get an answer.
0:00 Intro
0:27 Repaint and update and tearing
3:47 Seeing the call stack for repaint in the debugger
6:25 Now see the call stack for update
11:01 Compression of mouseMoveEvent
13:08 Turn of compression using XCB
14:40 Compression on windows
15:15 Move and resize event
17:07 Hope you did learn something from this episode
Links:
* Episode talking about the d-pointer: https://youtu.be/N89s0c8qRxc?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI&t=617
* Event compression of mouse events using xcb: https://codebrowser.dev/qt6/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp.html#9644
* Youtube series on multithreading with Qt: https://www.youtube.com/playlist?list=PL6CJYn40gN6jgr-Rpl3J4XDQYhmUnxb-g
The example code showcased in this video is available here: https://github.com/KDABLabs/kdabtv/tree/master/Qt-Widgets-and-more/update-vs-repaint
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI