src/hbwidgets/dataform/hbdataformheadingwidget_p.cpp
changeset 21 4633027730f5
parent 2 06ff229162e9
equal deleted inserted replaced
7:923ff622b8b9 21:4633027730f5
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
    25 
    25 
    26 #include "hbdataformheadingwidget_p.h"
    26 #include "hbdataformheadingwidget_p.h"
       
    27 #include "hbstyle_p.h"
    27 
    28 
    28 #include <hbcombobox.h>
    29 #include <hbcombobox.h>
    29 #include <hbstyleoptiondataform_p.h>
    30 #include <hbstyleoptiondataform_p.h>
    30 #include <QGraphicsItem>
    31 #include <QGraphicsItem>
    31 
    32 
    48 }
    49 }
    49 
    50 
    50 void HbDataFormHeadingWidget::createPrimitives()
    51 void HbDataFormHeadingWidget::createPrimitives()
    51 {
    52 {
    52     if(!mBackgroundItem) {
    53     if(!mBackgroundItem) {
    53         mBackgroundItem = style()->createPrimitive(HbStyle::P_DataForm_heading_background, this);
    54         mBackgroundItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_DataForm_heading_background, this);
    54     }
    55     }
    55     if(!mHeading.isEmpty()) {
    56     if(!mHeading.isEmpty()) {
    56         if(!mHeadingItem){
    57         if(!mHeadingItem){
    57             setProperty( "hasHeading", true );
    58             setProperty( "hasHeading", true );
    58             mHeadingItem = style()->createPrimitive(HbStyle::P_DataForm_heading, this);
    59             mHeadingItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_DataForm_heading, this);
    59         }
    60         }
    60     } else {
    61     } else {
    61         setProperty( "hasHeading", false );
    62         setProperty( "hasHeading", false );
    62         if(mHeadingItem){
    63         if(mHeadingItem){
    63             delete mHeadingItem;
    64             delete mHeadingItem;
    66     }
    67     }
    67 
    68 
    68     if(!mDescription.isEmpty()) {
    69     if(!mDescription.isEmpty()) {
    69         if(!mDescriptionItem) {            
    70         if(!mDescriptionItem) {            
    70             setProperty( "hasDescription", true );
    71             setProperty( "hasDescription", true );
    71             mDescriptionItem = style()->createPrimitive(HbStyle::P_DataForm_description, this);
    72             mDescriptionItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_DataForm_description, this);
    72         }
    73         }
    73     } else {                  
    74     } else {                  
    74         setProperty( "hasDescription", false );
    75         setProperty( "hasDescription", false );
    75         if(mDescriptionItem) {
    76         if(mDescriptionItem) {
    76             delete mDescriptionItem;
    77             delete mDescriptionItem;
    83 {
    84 {
    84     HbStyleOptionDataForm dataFormOption;
    85     HbStyleOptionDataForm dataFormOption;
    85     initStyleOption(&dataFormOption);
    86     initStyleOption(&dataFormOption);
    86 
    87 
    87     if(mHeadingItem) {
    88     if(mHeadingItem) {
    88         style()->updatePrimitive( mHeadingItem, HbStyle::P_DataForm_heading, &dataFormOption);
    89         HbStylePrivate::updatePrimitive( mHeadingItem, HbStylePrivate::P_DataForm_heading, &dataFormOption);
    89     }
    90     }
    90 
    91 
    91     if(mDescriptionItem) {
    92     if(mDescriptionItem) {
    92         style()->updatePrimitive( mDescriptionItem, HbStyle::P_DataForm_description,
    93         HbStylePrivate::updatePrimitive( mDescriptionItem, HbStylePrivate::P_DataForm_description,
    93             &dataFormOption);
    94             &dataFormOption);
    94     }
    95     }
    95     if(mBackgroundItem) {
    96     if(mBackgroundItem) {
    96         style()->updatePrimitive(
    97         HbStylePrivate::updatePrimitive(
    97             mBackgroundItem, HbStyle::P_DataForm_heading_background, &dataFormOption);
    98             mBackgroundItem, HbStylePrivate::P_DataForm_heading_background, &dataFormOption);
    98     }
    99     }
    99 }
   100 }
   100 
   101 
   101 void HbDataFormHeadingWidget::callPolish()
   102 void HbDataFormHeadingWidget::callPolish()
   102 {
   103 {