def processEvents(self):
     # hack copied from QgsVectorLayerInterruption.... .mustStop
     # to allow responsive cancelation on linux
     i = 0
     while i < 100 and QCoreApplication.hasPendingEvents():
         QCoreApplication.processEvents()
         i += 1