169 q->repolish(); |
169 q->repolish(); |
170 } |
170 } |
171 |
171 |
172 |
172 |
173 /*! |
173 /*! |
174 @alpha |
174 @beta |
175 @hbwidgets |
175 @hbwidgets |
176 \class HbGroupBox |
176 \class HbGroupBox |
177 |
177 |
178 \brief HbGroupBox shows the user that a set of controls belong together. |
178 \brief HbGroupBox shows the user that a set of controls belong together. |
179 |
179 |
180 HbGroupBox is a container that provides the following : |
180 HbGroupBox is a container, which can have following Elementes: |
181 |
181 |
182 \li Heading: text only |
182 \li Heading: A heading contains one row text and disclosure indicator if the disclosure mechanism is on. |
183 \li Body content: arbitrary content (any HbWidget) |
183 \li Body content: Can have arbitrary content (any HbWidget)and application is responsible for its layout. |
184 \li Disclosure mechanism: expands and collapses the body content; |
184 \li Disclosure Indicator: Indicates the expands and collapses state of body; |
185 |
185 |
186 There are three types of GroupBox: |
186 There are three types of GroupBox: |
187 |
187 |
188 \li Simple Label - it's only function is to show relationship between items. |
188 \li Simple Label - Simple Label is to indicate the users position in the application hierarchy |
189 simple Label shows a heading with marquee, no disclosure mechanism, and |
189 or to display a textual label and its noninteractive. |
190 no body content. Marquee is disabled by default.Also it is not focusable. |
190 Simple Label has a heading text with marquee, no disclosure mechanism, and |
|
191 no body content.Simple label only has heading element. |
|
192 Marquee is disabled by default, can be enabled using setMarqueeHeading () .Also it is not focusable. |
191 |
193 |
192 Example usage: For SimpleLabel type groupbox |
194 Example usage: For SimpleLabel type groupbox |
193 \code |
195 \code |
194 // create groupBox and set only heading; without any body content |
196 // create groupBox and set only heading; without any body content |
195 HbGroupBox *simpleLabel = new HbGroupBox(); |
197 HbGroupBox *simpleLabel = new HbGroupBox(); |
196 simpleLabel->setHeading("Simple label groupBox comes with marquee disabled by default"); |
198 simpleLabel->setHeading("Simple label groupBox comes with marquee disabled by default"); |
|
199 //to make marqee enabled |
|
200 simpleLabel->setMarqueeHeading(true); |
197 \endcode |
201 \endcode |
198 |
202 |
199 \image html simpleLabelgroupbox.png A SimpleLabel groupbox |
203 \image html simpleLabelgroupbox.png A SimpleLabel groupbox |
200 |
204 |
201 |
205 |
202 \li Rich Label - does not show a heading and all content is in the body area |
206 \li Rich Label - Rich label can contain dynamic content,which themselves can be interactive,or informative |
203 with no marquee and no disclosure control.Body Content must describe its own behavior and layout. |
207 with no heading ,no marquee and no disclosure control.Body Content must describe its own behavior and layout. |
204 |
208 |
205 Example usage: For RichLabel type groupbox |
209 Example usage: For RichLabel type groupbox |
206 \code |
210 \code |
207 // create groupBox and set only content; without any heading |
211 // create groupBox and set only content; without any heading |
208 HbGroupBox *richHeading = new HbGroupBox(); |
212 HbGroupBox *richLabel = new HbGroupBox(); |
209 // content widget can be any HbWidget |
213 HbPushButton *button = new HbPushButton(HbIcon(QString("qtg_large_info")),"Ovi"); |
210 // layouting and interaction behaviour inside Content widget is application's responsiblity |
|
211 HbPushButton *button = new HbPushButton(HbIcon(":/icons/ovi.png"),"Ovi"); |
|
212 button->setAdditionalText("Launch Ovi Music store"); |
214 button->setAdditionalText("Launch Ovi Music store"); |
213 button->setOrientation(Qt::Vertical); |
215 richLabel->setContentWidget(button); |
214 button->setTextAlignment(Qt::AlignLeft); |
216 mainlayout->addItem(richLabel); |
215 richHeading->setContentWidget(button); |
|
216 \endcode |
217 \endcode |
217 |
218 |
218 \image html richLabelgroupbox.png A RichLabel groupbox. |
219 \image html richLabelgroupbox.png A RichLabel groupbox. |
219 In RichLabel type, groupbox provides background for body content. |
220 In RichLabel type, groupbox provides background for body content. |
220 |
221 |
221 \li Collapsing container - also allows the user to show or hide the content of the groupBox. |
222 \li Collapsing container - Collapsing container allows the user to show or hide the content of the groupBox. |
222 It always has a heading and body content; optionally has a disclosure mechanism. |
223 It always has a heading and body content; optionally has a disclosure mechanism. |
223 The heading does not marquee.The collapse/expand disclosure mechanism is located |
224 The heading does not marquee.The body content must describe its own behavior and layout. |
224 in the heading and is the chief utility of this type of group box. |
225 The collapse/expand disclosure mechanism is located in the heading and is the chief utility of this type of groupbox. |
225 |
226 |
226 If disclosure mechanism is Off, then heading will appear without expand/collapse indication icon |
227 If disclosure mechanism is Off,then heading will appear without expand/collapse indication icon |
227 heading.Also the user will not be able to expand/collapse the body content. |
228 heading.Also the user will not be able to expand/collapse the body content. |
228 |
229 |
229 Example usage:For collapsingContainer groupbox |
230 Example usage:For collapsingContainer groupbox |
230 \code |
231 \code |
231 // create groupBox and set both heading and content |
232 // create groupBox and set both heading and content |
260 /*! |
261 /*! |
261 \fn void HbGroupBox::clicked() |
262 \fn void HbGroupBox::clicked() |
262 |
263 |
263 This signal is emitted only in case of richLabel and collapsing container groupbox, |
264 This signal is emitted only in case of richLabel and collapsing container groupbox, |
264 whenever click happened on body content.If the body content set is an interactive widget |
265 whenever click happened on body content.If the body content set is an interactive widget |
265 and consumes mouse press event, then clicked signal will not get emitted from groupBox in that case. |
266 and consumes mouse press event, then in that case clicked signal will not get emitted from groupBox. |
266 */ |
267 */ |
267 |
268 |
268 /*! |
269 /*! |
269 \fn void HbGroupBox::toggled(bool) |
270 \fn void HbGroupBox::toggled(bool) |
270 |
271 |
271 This signal is emitted only in case of collapsing container groupbox, |
272 This signal is emitted only in case of collapsing container groupbox, |
272 whenever groupbox is collapsed/expanded |
273 whenever groupbox is collapsed/expanded |
273 */ |
274 */ |
274 |
275 |
275 /*! |
276 /*! |
276 @alpha |
277 @beta |
277 Constructs a group box with the given \a parent. |
278 Constructs a groupbox with the given \a parent. |
278 */ |
279 */ |
279 HbGroupBox::HbGroupBox( QGraphicsItem *parent) |
280 HbGroupBox::HbGroupBox( QGraphicsItem *parent) |
280 : HbWidget(*new HbGroupBoxPrivate, parent) |
281 : HbWidget(*new HbGroupBoxPrivate, parent) |
281 { |
282 { |
282 Q_D( HbGroupBox ); |
283 Q_D( HbGroupBox ); |
397 return d->mHeadingWidget->collapsable; |
400 return d->mHeadingWidget->collapsable; |
398 return false; |
401 return false; |
399 } |
402 } |
400 |
403 |
401 /*! |
404 /*! |
402 @alpha |
405 @beta |
403 |
406 |
404 Sets whether the groupbox collapsed or expanded |
407 Sets whether the groupbox collapsed or expanded |
405 |
408 |
406 If the groupbox is collapsed,the group box's content widget are hidden; |
409 If the groupbox is collapsed,the groupbox's content widget are hidden; |
407 otherwise they will be visible |
410 otherwise they will be visible |
408 |
411 |
409 setCollapsed on groupbox will emit signal toggled( bool ) |
412 setCollapsed on groupbox will emit signal toggled( bool ) |
410 upon collapse\expand of content widget |
413 upon collapse\expand of content widget |
411 |
414 |
412 Only collapsable groupboxes can be collapsed. (i.e)this API will not do anything |
415 Only collapsable groupbox can be collapsed. (i.e)this API will not do anything |
413 if group box is not collapsable.By default, group boxes are not collapsed. |
416 if groupbox is not collapsable.By default, groupbox is not collapsed. |
414 |
417 |
415 Note: collapsed property is valid only for collapsing container type. |
418 Note: collapsed property is valid only for collapsing container type. |
416 If collapsed is set on simpleLabel or richLabel type groupBox, it will be ignored |
419 If collapsed is set on simpleLabel or richLabel type groupBox, it will be ignored |
417 |
420 |
418 \sa isCollapsed \sa setCollapsable |
421 \sa isCollapsed \sa setCollapsable |