Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

processEvents - Filter paintEvents


  • Qt Champions 2017

    HI
    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 ?
    OR
    Is there way to stop the statemachine immidiately without calling processEvents.


  • Qt Champions 2017

    @dheerendra
    Hi,
    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