Skip to main content

Command Palette

Search for a command to run...

Qt oddness within Unity

Updated
1 min read

Qt oddness within Unity

9 Aug

Written By Roderick Kennedy

I've noticed some very strange behaviour when launching a Qt-based UI from Unity recently. Possibly from updating Qt, but the UI would fail to respond to mouse clicks or other signals, until I dragged or resized the window, at which point, all the inputs I had made would then replay very quickly and get up to date.
The only solution I've found is to create a QTimer outside of the main window context (the QApplication is its owner), and set it to call QCoreApplication::processEvents every 100ms or so.

QTimer *timer=new QTimer(pApp); timer->setSingleShot(false); timer->start(100); CONNECT_AUTO(timer,SIGNAL(timeout()),w,SLOT(Idle()));

Roderick Kennedy

More from this blog

Roderick's Debug Diary

58 posts

https://mastodon.social/@rvkennedy