Ejemplo n.º 1
0
    def busyCursor(self, cursor=None):
        """Performs code with a busy cursor set for the application.
        
        The default cursor to use is the Qt.WaitCursor. Usage:
        
        with app.busyCursor():
            ...

        """
        if cursor is None:
            cursor = QCursor(Qt.WaitCursor)
        KApplication.setOverrideCursor(cursor)
        try:
            yield
        finally:
            KApplication.restoreOverrideCursor()