equal
deleted
inserted
replaced
22 ** Nokia at developer.feedback@nokia.com. |
22 ** Nokia at developer.feedback@nokia.com. |
23 ** |
23 ** |
24 ****************************************************************************/ |
24 ****************************************************************************/ |
25 |
25 |
26 #include "hbgroupboxcontentwidget_p.h" |
26 #include "hbgroupboxcontentwidget_p.h" |
27 #include <hbstyleoption.h> |
27 #include <hbstyleoption_p.h> |
28 #include <hbscrollarea.h> |
28 #include <hbscrollarea.h> |
29 #include <hbgesturefilter.h> |
|
30 #include <hbgesture.h> |
|
31 #include <QGraphicsSceneMouseEvent> |
29 #include <QGraphicsSceneMouseEvent> |
32 #include <hbwidgetfeedback.h> |
30 #include <hbwidgetfeedback.h> |
33 #ifdef HB_GESTURE_FW |
31 #ifdef HB_GESTURE_FW |
34 #include <hbtapgesture.h> |
32 #include <hbtapgesture.h> |
35 #include <hbtapandholdgesture.h> |
33 #include <hbtapandholdgesture.h> |
48 */ |
46 */ |
49 HbGroupBoxContentWidget::HbGroupBoxContentWidget(QGraphicsItem *parent ) : |
47 HbGroupBoxContentWidget::HbGroupBoxContentWidget(QGraphicsItem *parent ) : |
50 HbWidget(parent), |
48 HbWidget(parent), |
51 mContent(0), |
49 mContent(0), |
52 mBackgroundItem(0), |
50 mBackgroundItem(0), |
|
51 groupBoxType( GroupBoxTypeUnknown ), |
53 contentPressed(false) |
52 contentPressed(false) |
54 |
|
55 { |
53 { |
56 groupBox = qgraphicsitem_cast<HbGroupBox*>( parent ); |
54 groupBox = qgraphicsitem_cast<HbGroupBox*>( parent ); |
57 |
55 |
58 createPrimitives(); |
56 createPrimitives(); |
59 createConnection(); |
57 createConnection(); |
120 Sets the groupbox content widgets type. |
118 Sets the groupbox content widgets type. |
121 Creates primitves if needed based on type set |
119 Creates primitves if needed based on type set |
122 */ |
120 */ |
123 void HbGroupBoxContentWidget::setType(GroupBoxType type) |
121 void HbGroupBoxContentWidget::setType(GroupBoxType type) |
124 { |
122 { |
125 groupBoxType = type; |
123 if( groupBoxType != type ){ |
126 // set dynamic properties for type |
124 groupBoxType = type; |
127 if(groupBoxType == GroupBoxCollapsingContainer) |
125 // set dynamic properties for type |
128 setProperty("groupBoxType",3); |
126 if(groupBoxType == GroupBoxCollapsingContainer) |
129 else if(groupBoxType == GroupBoxRichLabel) |
127 setProperty("groupBoxType",3); |
130 setProperty("groupBoxType",2); |
128 else if(groupBoxType == GroupBoxRichLabel) |
131 |
129 setProperty("groupBoxType",2); |
132 if(groupBoxType != GroupBoxSimpleLabel){ |
130 |
133 createPrimitives(); |
131 if(groupBoxType != GroupBoxSimpleLabel){ |
134 //createConnection(); |
132 createPrimitives(); |
|
133 //createConnection(); |
|
134 } |
135 } |
135 } |
136 } |
136 } |
137 |
137 |
138 /*! |
138 /*! |
139 internal |
139 internal |
145 // delete old content set |
145 // delete old content set |
146 if ( mContent ) { |
146 if ( mContent ) { |
147 delete mContent; |
147 delete mContent; |
148 mContent = 0; |
148 mContent = 0; |
149 } |
149 } |
150 // if NULL widget is passed dont do anything |
150 // if NULL widget is passed don't do anything |
151 if ( !widget ) { |
151 if ( !widget ) { |
152 return; |
152 return; |
153 } |
153 } |
154 |
154 |
155 mContent = widget; |
155 mContent = widget; |