From e2e1532f2b7e5cc66f232e66ef10005c70cd7112 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Fri, 24 Sep 2010 15:19:14 +0200
Subject: [PATCH] Designer: Reset override cursors while loading forms...

in case Designer shows messages about missing resources or such.
---
 src/plugins/designer/formwindoweditor.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp
index 39c22d062c1..f18f57e0a7a 100644
--- a/src/plugins/designer/formwindoweditor.cpp
+++ b/src/plugins/designer/formwindoweditor.cpp
@@ -49,6 +49,7 @@
 #include <QtCore/QDebug>
 #include <QtCore/QFileInfo>
 #include <QtCore/QFile>
+#include <QtGui/QApplication>
 
 namespace Designer {
 
@@ -103,7 +104,20 @@ bool FormWindowEditor::createNew(const QString &contents)
     if (contents.isEmpty())
         return false;
 
+    // If we have an override cursor, reset it over Designer loading,
+    // should it pop up messages about missing resources or such.
+    const bool hasOverrideCursor = QApplication::overrideCursor();
+    QCursor overrideCursor;
+    if (hasOverrideCursor) {
+        overrideCursor = QCursor(*QApplication::overrideCursor());
+        QApplication::restoreOverrideCursor();
+    }
+
     form->setContents(contents);
+
+    if (hasOverrideCursor)
+        QApplication::setOverrideCursor(overrideCursor);
+
     if (form->mainContainer() == 0)
         return false;
 
-- 
GitLab