Important: Please read the Qt Code of Conduct -

How to reduce the time Qt waits before next servicing its event queue?

  • Running on an embedded Linux target, Qt is waiting for 300 ms after each clearing of the main GUI thread's event queue before next servicing events.

    This device has a knob that rotates. A dedicated thread checks for knob rotations every 10 ms and, on detecting one, emits a signal which gets pushed into the Qt event queue in the main GUI thread. Although the signal is sent in a timely manner, and even when there are no other events queued and no other competing thread activity, Qt does not service this (or any other) event in the main GUI thread for [0, 300] ms (with the average unnecessary lag time being 150 ms).

    This Qt behavior also makes animations impossible.

    How can I reduce this time? Something like 10 ms would be okay. 300 ms is just way too long.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are you using ?
    What distribution do you have on that device ?
    What kind of device is it ?
    What are its specifications ?

  • @SGaist Hi, and thank you very much for responding to this post. The Qt version is 5.12.0. The Qt distribution is Yocto 2.4.4 Rocko. It's an embedded medical device, Freescale i.MX6 Solo, with a 7" touchscreen.

  • Lifetime Qt Champion

    Since it's medical, did you consider using the safe renderer ?

Log in to reply