src/hbwidgets/dataform/hbdatagroup_p.cpp
changeset 28 b7da29130b0e
parent 23 e6ad4ef83b23
equal deleted inserted replaced
23:e6ad4ef83b23 28:b7da29130b0e
    98                     mPageCombo = 0;
    98                     mPageCombo = 0;
    99                     delete mPageComboBackgroundItem;
    99                     delete mPageComboBackgroundItem;
   100                     mPageComboBackgroundItem = 0;
   100                     mPageComboBackgroundItem = 0;
   101 
   101 
   102                     q->repolish();
   102                     q->repolish();
   103 
       
   104                     QCoreApplication::sendPostedEvents(q, QEvent::Polish);
       
   105 
       
   106                 }
   103                 }
   107             }
   104             }
   108         }
   105         }
   109         // setModelIndexes will be create or delete items according to the 
   106         // setModelIndexes will be create or delete items according to the 
   110         // itemTransient state set using expand function call above
   107         // itemTransient state set using expand function call above
   291             mPageComboBackgroundItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_DataGroupComboBackground, q);
   288             mPageComboBackgroundItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_DataGroupComboBackground, q);
   292             HbStyle::setItemName(mPageComboBackgroundItem,"dataGroup_ComboBackground");
   289             HbStyle::setItemName(mPageComboBackgroundItem,"dataGroup_ComboBackground");
   293         }
   290         }
   294 
   291 
   295         q->repolish();
   292         q->repolish();
   296 
       
   297         QCoreApplication::sendPostedEvents(q, QEvent::Polish);
       
   298     }
   293     }
   299 
   294 
   300     // disconnecting to avoid pagechanged signal when setting group.
   295     // disconnecting to avoid pagechanged signal when setting group.
   301     QObject::disconnect(mPageCombo,SIGNAL(currentIndexChanged(int)),
   296     QObject::disconnect(mPageCombo,SIGNAL(currentIndexChanged(int)),
   302             q,SLOT(pageChanged(int)));
   297             q,SLOT(pageChanged(int)));
   424 void HbDataGroup::setDescription( const QString &description )
   419 void HbDataGroup::setDescription( const QString &description )
   425 {
   420 {
   426      
   421      
   427     Q_D( HbDataGroup );
   422     Q_D( HbDataGroup );
   428     d->mGroupHeading->mDescription = description;
   423     d->mGroupHeading->mDescription = description;
       
   424     if(d->mGroupHeading->mDescription.isEmpty()) {
       
   425         setProperty("hasDescription",false);
       
   426     } else {
       
   427         setProperty("hasDescription",true);
       
   428     }
   429     d->mGroupHeading->createPrimitives( );    
   429     d->mGroupHeading->createPrimitives( );    
   430     d->mGroupHeading->updatePrimitives( );
   430     d->mGroupHeading->updatePrimitives( );
   431 }
   431 }
   432 
   432 
   433 
   433 
   662             static_cast<QGraphicsWidget *>(d->mSharedData->mItemView->contentWidget()));
   662             static_cast<QGraphicsWidget *>(d->mSharedData->mItemView->contentWidget()));
   663 
   663 
   664     HbDataFormModelItem::DataItemType contentWidgetType = 
   664     HbDataFormModelItem::DataItemType contentWidgetType = 
   665             static_cast<HbDataFormModelItem::DataItemType>(
   665             static_cast<HbDataFormModelItem::DataItemType>(
   666             (d->mIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt());
   666             (d->mIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt());
       
   667     connect(this, SIGNAL(itemShown(const QModelIndex&)), 
       
   668                 d->mSharedData->mItemView, SIGNAL(itemShown(const QModelIndex&)));   
   667 
   669 
   668     if ( contentWidgetType == HbDataFormModelItem::GroupItem ) {
   670     if ( contentWidgetType == HbDataFormModelItem::GroupItem ) {
   669         d->mGroupHeading = new HbDataGroupHeadingWidget();
   671         d->mGroupHeading = new HbDataGroupHeadingWidget();
   670         HbStyle::setItemName(d->mGroupHeading,"dataGroup_HeadingWidget");
   672         HbStyle::setItemName(d->mGroupHeading,"dataGroup_HeadingWidget");
   671         d->mGroupHeading->setParentItem(this);
   673         d->mGroupHeading->setParentItem(this);
   682         //set the heading of data group
   684         //set the heading of data group
   683         QString groupDescription = d->mIndex.data(
   685         QString groupDescription = d->mIndex.data(
   684             HbDataFormModelItem::DescriptionRole).toString();
   686             HbDataFormModelItem::DescriptionRole).toString();
   685         if(!groupDescription.isEmpty()) {
   687         if(!groupDescription.isEmpty()) {
   686             setDescription(groupDescription);
   688             setDescription(groupDescription);
       
   689         } else {
       
   690             setProperty("hasDescription",false);
   687         }
   691         }
   688 
   692 
   689         //update visualization based on whether item is enabled or disabled
   693         //update visualization based on whether item is enabled or disabled
   690         HbDataFormModel* data_model = static_cast<HbDataFormModel*>( itemView( )->model( ) );
   694         HbDataFormModel* data_model = static_cast<HbDataFormModel*>( itemView( )->model( ) );
   691         HbDataFormModelItem *model_item = 
   695         HbDataFormModelItem *model_item =