equal
deleted
inserted
replaced
39 #endif |
39 #endif |
40 |
40 |
41 #include <QDebug> |
41 #include <QDebug> |
42 #include <QGraphicsGridLayout> |
42 #include <QGraphicsGridLayout> |
43 #include <QEventLoop> |
43 #include <QEventLoop> |
44 #include <QPainter> |
|
45 #include <QGraphicsLinearLayout> |
44 #include <QGraphicsLinearLayout> |
46 |
45 |
47 /*! |
46 /*! |
48 @stable |
47 @stable |
49 @hbcore |
48 @hbcore |
110 q->setFlag(QGraphicsItem::ItemClipsChildrenToShape); |
109 q->setFlag(QGraphicsItem::ItemClipsChildrenToShape); |
111 } |
110 } |
112 |
111 |
113 void HbToolBarExtensionPrivate::doLazyInit() |
112 void HbToolBarExtensionPrivate::doLazyInit() |
114 { |
113 { |
115 Q_Q(HbToolBarExtension); |
|
116 if ( !lazyInitDone ) { |
114 if ( !lazyInitDone ) { |
117 q->setBackgroundItem( HbStyle::P_ToolBarExtension_background ); |
115 setBackgroundItem(HbStyle::P_ToolBarExtension_background); |
118 #ifdef HB_EFFECTS |
116 #ifdef HB_EFFECTS |
119 if (!extensionEffectsLoaded){ |
117 if (!extensionEffectsLoaded){ |
120 HbEffectInternal::add("HB_TBE", "tbe_button_click", "clicked"); |
118 HbEffectInternal::add("HB_TBE", "tbe_button_click", "clicked"); |
121 extensionEffectsLoaded = true; |
119 extensionEffectsLoaded = true; |
122 } |
120 } |
212 HbToolButton *button = 0; |
210 HbToolButton *button = 0; |
213 |
211 |
214 HbAction *hbAction = qobject_cast<HbAction *>( event->action() ); |
212 HbAction *hbAction = qobject_cast<HbAction *>( event->action() ); |
215 |
213 |
216 if (hbAction) { |
214 if (hbAction) { |
|
215 if (!q->contentWidget()) { |
|
216 initialiseContent(); // create now to prevent mem leak below |
|
217 } |
217 button = new HbToolButton(hbAction, q->contentWidget()); |
218 button = new HbToolButton(hbAction, q->contentWidget()); |
218 } else { |
219 } else { |
219 button = new HbToolButton(q->contentWidget()); |
220 button = new HbToolButton(q->contentWidget()); |
220 HbToolButtonPrivate::d_ptr(button)->action = event->action(); |
221 HbToolButtonPrivate::d_ptr(button)->action = event->action(); |
221 QObject::connect(event->action(), SIGNAL(triggered()), button, SLOT(_q_actionTriggered())); |
222 QObject::connect(event->action(), SIGNAL(triggered()), button, SLOT(_q_actionTriggered())); |
336 /*! |
337 /*! |
337 Destructor. |
338 Destructor. |
338 */ |
339 */ |
339 HbToolBarExtension::~HbToolBarExtension() |
340 HbToolBarExtension::~HbToolBarExtension() |
340 { |
341 { |
341 disconnect(); |
|
342 } |
342 } |
343 |
343 |
344 /*! |
344 /*! |
345 \overload |
345 \overload |
346 |
346 |