Important: Please read the Qt Code of Conduct -

processEvents - Filter paintEvents

  • Qt Champions 2017

    I'm have single threaded application which has StateMachine and CustomWidget. When I stop the statemachine it does not stop immediately as it is processed through event loop. I need to call qApp->processEvents() to stop the statemachine immidiately. If I call processEvents, it processes the paint events also. This makes the UI flickered. UI ficker is main issue.

    I would like to call processEvents but I don't want to process the paint events. Is there way ?
    Is there way to stop the statemachine immidiately without calling processEvents.

  • Qt Champions 2017

    You could try this:

    QCoreApplication::sendPostedEvents(NULL, QEvent::StateMachineSignal);
    QCoreApplication::sendPostedEvents(NULL, QEvent::StateMachineWrapped);

    Kind regards.

  • Qt Champions 2017

    Thank you for you reply. Problem was caused by half-done paintEvent function and recursion. After careful analysing issue is resolved.

Log in to reply