clock/clockui/clockviews/src/clockhomecityitem.cpp
changeset 57 bb2d3e476f29
parent 55 2c54b51f39c4
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
    24 #include <HbFrameItem>
    24 #include <HbFrameItem>
    25 #include <HbFrameDrawer>
    25 #include <HbFrameDrawer>
    26 
    26 
    27 // User Includes.
    27 // User Includes.
    28 #include "clockhomecityitem.h"
    28 #include "clockhomecityitem.h"
       
    29 #include "OstTraceDefinitions.h"
       
    30 #ifdef OST_TRACE_COMPILER_IN_USE
       
    31 #include "clockhomecityitemTraces.h"
       
    32 #endif
       
    33 
    29 
    34 
    30 /*!
    35 /*!
    31 	\class ClockHomeCityItem
    36 	\class ClockHomeCityItem
    32 
    37 
    33 	This class creates all the primitives for ClockHomeCityItem item.
    38 	This class creates all the primitives for ClockHomeCityItem item.
    39 	\param parent Pointer to QGraphicsItem.
    44 	\param parent Pointer to QGraphicsItem.
    40  */
    45  */
    41 ClockHomeCityItem::ClockHomeCityItem(QGraphicsItem *parent) :
    46 ClockHomeCityItem::ClockHomeCityItem(QGraphicsItem *parent) :
    42 HbWidget(parent)
    47 HbWidget(parent)
    43 {
    48 {
       
    49 	OstTraceFunctionEntry0( CLOCKHOMECITYITEM_CLOCKHOMECITYITEM_ENTRY );
    44 	// Path for widgetml and css files.
    50 	// Path for widgetml and css files.
    45 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem.css");
    51 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem.css");
    46 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem.widgetml");
    52 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem.widgetml");
    47 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem_color.css");
    53 	HbStyleLoader::registerFilePath(":/style/clockhomecityitem_color.css");
    48 	
    54 	
    50 	HbFrameItem *frame = new HbFrameItem(this);
    56 	HbFrameItem *frame = new HbFrameItem(this);
    51 	frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    57 	frame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
    52 	frame->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal");
    58 	frame->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox_normal");
    53 	setBackgroundItem(frame->graphicsItem(), -2);
    59 	setBackgroundItem(frame->graphicsItem(), -2);
    54 
    60 
       
    61 	OstTraceFunctionExit0( CLOCKHOMECITYITEM_CLOCKHOMECITYITEM_EXIT );
    55 }
    62 }
    56 
    63 
    57 /*!
    64 /*!
    58  Destructor.
    65  Destructor.
    59  */
    66  */
    60 ClockHomeCityItem::~ClockHomeCityItem()
    67 ClockHomeCityItem::~ClockHomeCityItem()
    61 {
    68 {
       
    69 	OstTraceFunctionEntry0( DUP1_CLOCKHOMECITYITEM_CLOCKHOMECITYITEM_ENTRY );
    62 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.css");
    70 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.css");
    63 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.widgetml");
    71 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem.widgetml");
    64 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem_color.css");
    72 	HbStyleLoader::unregisterFilePath(":/style/clockhomecityitem_color.css");
       
    73 	OstTraceFunctionExit0( DUP1_CLOCKHOMECITYITEM_CLOCKHOMECITYITEM_EXIT );
    65 }
    74 }
    66 
    75 
    67 /*!
    76 /*!
    68 	Sets the data for HomeCity items.
    77 	Sets the data for HomeCity items.
    69 	To set textitem data use Qt::DisplayRole
    78 	To set textitem data use Qt::DisplayRole
    70 	To set iconitem data use Qt::DecorationRole
    79 	To set iconitem data use Qt::DecorationRole
    71 	\param itemData contains the data for all the primitives.
    80 	\param itemData contains the data for all the primitives.
    72  */
    81  */
    73 void ClockHomeCityItem::setHomeCityItemData(const QVariantMap &itemData)
    82 void ClockHomeCityItem::setHomeCityItemData(const QVariantMap &itemData)
    74 {
    83 {
       
    84 	OstTraceFunctionEntry0( CLOCKHOMECITYITEM_SETHOMECITYITEMDATA_ENTRY );
    75 	if (!itemData.isEmpty()) {
    85 	if (!itemData.isEmpty()) {
    76 		QMapIterator<QString, QVariant> iter(itemData);
    86 		QMapIterator<QString, QVariant> iter(itemData);
    77 		while (iter.hasNext()) {
    87 		while (iter.hasNext()) {
    78 			iter.next();
    88 			iter.next();
    79 			int value = iter.key().toInt();
    89 			int value = iter.key().toInt();
   119 					break;
   129 					break;
   120 			}
   130 			}
   121 		}
   131 		}
   122 		repolish();
   132 		repolish();
   123 	}
   133 	}
       
   134 	OstTraceFunctionExit0( CLOCKHOMECITYITEM_SETHOMECITYITEMDATA_EXIT );
   124 }
   135 }
   125 
   136 
   126 // End of file	--Don't remove this.
   137 // End of file	--Don't remove this.