From cd1042e974e619acc07b7e3d3dcdde786c9fc564 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Thu, 25 Feb 2010 15:29:40 +0100
Subject: [PATCH] QmlDesigner.propertyEditor: setting Cleanlooks style on
 property editor

---
 .../propertyeditor/basicwidgets.cpp           | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
index 4024e0b09b0..4eb2d4cc0b5 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
@@ -44,6 +44,42 @@
 #include <QDebug>
 #include <QApplication>
 #include <QGraphicsOpacityEffect>
+#include <QCleanlooksStyle>
+
+
+QT_BEGIN_NAMESPACE
+
+class CleanLooksSingleton
+{
+   public:
+     static CleanLooksSingleton* instance();
+     QCleanlooksStyle* style() {return &m_style; };
+
+   private:
+     static CleanLooksSingleton *m_instance;
+     QCleanlooksStyle m_style;
+
+     CleanLooksSingleton() {}
+     CleanLooksSingleton( const CleanLooksSingleton& );
+
+     class CleanLooksWatcher {
+         public: ~CleanLooksWatcher() {
+           if( CleanLooksSingleton::m_instance != 0 )
+             delete CleanLooksSingleton::m_instance;
+         }
+     };
+     friend class CleanLooksWatcher;
+};
+
+CleanLooksSingleton* CleanLooksSingleton::m_instance = 0;
+
+CleanLooksSingleton* CleanLooksSingleton::instance()
+{
+  static CleanLooksWatcher w;
+  if( m_instance == 0 )
+    m_instance = new CleanLooksSingleton();
+  return m_instance;
+}
 
 
 class QWidgetDeclarativeUI;
@@ -121,6 +157,7 @@ public:
         filter->setDuiTarget(this);
         m_mouseOver = false;
         q->installEventFilter(filter);
+        q->setStyle(CleanLooksSingleton::instance()->style());
         Q_ASSERT(q);
     }
     virtual ~QWidgetDeclarativeUI() {
-- 
GitLab