qhbstyle/qhbstyle.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    62 #include "qhbstyleanimation.h"
    62 #include "qhbstyleanimation.h"
    63 
    63 
    64 QT_BEGIN_NAMESPACE
    64 QT_BEGIN_NAMESPACE
    65 
    65 
    66 QHbStylePrivate::QHbStylePrivate() : m_styleManager(0),
    66 QHbStylePrivate::QHbStylePrivate() : m_styleManager(0),
    67     m_frameDrawer(new HbFrameDrawer),
    67     m_frameDrawer(0),
    68     m_animationGroup(new QParallelAnimationGroup)
    68     m_animationGroup(0)
    69 {
    69 {
    70 }
    70 }
    71 
    71 
    72 QHbStylePrivate::~QHbStylePrivate()
    72 QHbStylePrivate::~QHbStylePrivate()
    73 {
    73 {
    74 }
    74 }
    75 
    75 
    76 HbStyle* QHbStylePrivate::styleManager()
    76 HbStyle* QHbStylePrivate::styleManager()
    77 {
    77 {
       
    78     if (!m_styleManager) {
       
    79         HbInstance *instance = HbInstance::instance();
       
    80         setStyleManager(instance->style());
       
    81     }
       
    82     
    78     return m_styleManager;
    83     return m_styleManager;
    79 }
    84 }
    80 
    85 
    81 void QHbStylePrivate::setStyleManager(HbStyle* style)
    86 void QHbStylePrivate::setStyleManager(HbStyle* style)
    82 {
    87 {
    84     m_styleManager = style;
    89     m_styleManager = style;
    85 }
    90 }
    86 
    91 
    87 QParallelAnimationGroup* QHbStylePrivate::animationGroup()
    92 QParallelAnimationGroup* QHbStylePrivate::animationGroup()
    88 {
    93 {
       
    94     if (m_animationGroup.isNull())
       
    95         m_animationGroup.reset(new QParallelAnimationGroup());
    89     return m_animationGroup.data();
    96     return m_animationGroup.data();
    90 }
    97 }
    91 
    98 
    92 /*!
    99 /*!
    93   \internal
   100   \internal
    94  */
   101  */
    95 QHbStyle::QHbStyle() : QCommonStyle()
   102 QHbStyle::QHbStyle() : QCommonStyle()
    96 {
   103 {
    97     m_private = new QHbStylePrivate();
   104     m_private = new QHbStylePrivate();
    98     HbInstance *instance = HbInstance::instance();
       
    99 
       
   100     m_private->setStyleManager(instance->style());
       
   101 }
   105 }
   102 
   106 
   103 /*!
   107 /*!
   104   \internal
   108   \internal
   105  */
   109  */