qhbstyle/qhbstyle.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
--- a/qhbstyle/qhbstyle.cpp	Fri Jun 11 14:26:25 2010 +0300
+++ b/qhbstyle/qhbstyle.cpp	Wed Jun 23 19:08:38 2010 +0300
@@ -64,8 +64,8 @@
 QT_BEGIN_NAMESPACE
 
 QHbStylePrivate::QHbStylePrivate() : m_styleManager(0),
-    m_frameDrawer(new HbFrameDrawer),
-    m_animationGroup(new QParallelAnimationGroup)
+    m_frameDrawer(0),
+    m_animationGroup(0)
 {
 }
 
@@ -75,6 +75,11 @@
 
 HbStyle* QHbStylePrivate::styleManager()
 {
+    if (!m_styleManager) {
+        HbInstance *instance = HbInstance::instance();
+        setStyleManager(instance->style());
+    }
+    
     return m_styleManager;
 }
 
@@ -86,6 +91,8 @@
 
 QParallelAnimationGroup* QHbStylePrivate::animationGroup()
 {
+    if (m_animationGroup.isNull())
+        m_animationGroup.reset(new QParallelAnimationGroup());
     return m_animationGroup.data();
 }
 
@@ -95,9 +102,6 @@
 QHbStyle::QHbStyle() : QCommonStyle()
 {
     m_private = new QHbStylePrivate();
-    HbInstance *instance = HbInstance::instance();
-
-    m_private->setStyleManager(instance->style());
 }
 
 /*!