Please nominate your Qt Champions for 2021!

Running tests for key events in the background

  • Hi all,

    we are currently writing unit tests using QML TestCase and have found that simulated key events (using keyPress etc.) require the test window to be the active window. This problem actually exists for all key events created with the QTest class. We plan to run several instances of our application for acceptance tests in parallel to increase performance on multiple cores, but this would make all tests for key input fail.

    Is there a way to make this work, e.g. by decoupling the active state of the window from the QML scene's focus chain?


Log in to reply