Is there a way to discard all pending events? In a menu callback, I run
the following code:

        self.setStatusbarMessage("Goto home position...")
        self._model.hardware.gotoPosition(0., 0., wait=False)
        while self._model.hardware.isAxisMoving():
           
QtGui.QApplication.processEvents(QtCore.QEventLoop.ExcludeUserInputEvents)
        self.setStatusbarMessage("Home position reached", 10)

I periodically call the processEvents, because I want the current
position to be refreshed (from a thread). During the move, I don't want
any widgets to be active. This work fine, but all input events are
queued, and executed as soon as we leave the callback. If the user
clicks on different widgets, all actions will be executed :o(


--
   Frédéric

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to