src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp
changeset 6 c3690ec91ef8
parent 2 06ff229162e9
child 7 923ff622b8b9
--- a/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp	Fri Jun 11 13:58:22 2010 +0300
+++ b/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp	Wed Jun 23 18:33:25 2010 +0300
@@ -55,8 +55,6 @@
     mIconItem( 0 ),
     mTextItem( 0 ),
     mBackgroundItem( 0 ),
-    collapsable( true ),
-    collapsed( false),
     marqueeEnabled( false ),
     headingPressed(false),
     groupBoxType( GroupBoxTypeUnknown )
@@ -80,7 +78,6 @@
 */
 void HbGroupBoxHeadingWidget::init( )
 {
-
     createPrimitives( );
     if ( groupBoxType == GroupBoxCollapsingContainer ){
         createConnection( );    
@@ -95,7 +92,7 @@
 */
 void HbGroupBoxHeadingWidget::createPrimitives()
 {
-    if( groupBoxType == GroupBoxCollapsingContainer && collapsable ){
+    if( groupBoxType == GroupBoxCollapsingContainer && groupBox->isCollapsable() ){
         if ( !mIconItem ) {
             mIconItem = style( )->createPrimitive( HbStyle::P_GroupBoxHeading_icon , this );
         }
@@ -181,7 +178,7 @@
         if( groupBoxType == GroupBoxCollapsingContainer ){
             createConnection(); 
             // collapsed is false by default for CollapsingContainer
-            collapsed = false; 
+            //collapsed = false; 
             // marquee is disabled by default for CollapsingContainer
             marqueeEnabled = false;
         }
@@ -263,7 +260,8 @@
 void HbGroupBoxHeadingWidget::initStyleOption( HbStyleOptionGroupBox *option ) const
 {
     HbWidget::initStyleOption( option );
-    option->collapsed = collapsed;
+    //option->collapsed = collapsed; 
+    option->collapsed = groupBox->isCollapsed();
     option->heading = headingText;
     option->marqueeEnabled = marqueeEnabled;
     // state & type info reqd fo background primitve updation
@@ -322,7 +320,7 @@
     Q_UNUSED( event )
 #else 
     HbWidget::mousePressEvent( event );
-    if ( !collapsable ){
+    if ( !( groupBox->isCollapsable( ) ) ){
         event->ignore();
         return;
     }
@@ -389,11 +387,11 @@
         switch( tap->state() ) {
         case Qt::GestureStarted:  //
             {
-                if ( !collapsable ){
+                if ( !(groupBox->isCollapsable( )) ){
                     event->ignore( tap );
                     return;
                 }
-                if ( collapsable ) {
+                if ( groupBox->isCollapsable( ) ) {
                     HbWidgetFeedback::triggered( this, Hb::InstantPressed, Hb::ModifierCollapsedItem );
                 }
                 else {
@@ -424,7 +422,7 @@
             }
         case Qt::GestureFinished: // emit clicked
             {
-                if ( collapsable ) {
+                if ( groupBox->isCollapsable( ) ) {
                     HbWidgetFeedback::triggered( this, Hb::InstantReleased, Hb::ModifierCollapsedItem );
                 } else {
                     HbWidgetFeedback::triggered( this, Hb::InstantReleased );
@@ -436,7 +434,7 @@
                         HbEffect::start( mIconItem, HB_GROUPBOX_HEADING_TYPE, "iconclick" );
 #endif
                     }
-                    emit clicked( !collapsed );
+                    emit clicked( !(groupBox->isCollapsed()) );
                 }
                 // background primitive updation, upon mouse release
                 headingPressed = false;