27 */ |
28 */ |
28 |
29 |
29 /*! |
30 /*! |
30 constructor |
31 constructor |
31 */ |
32 */ |
32 CalenPluginLabel::CalenPluginLabel(MCalenServices& services, |
33 Q_DECL_EXPORT CalenPluginLabel::CalenPluginLabel(MCalenServices& services, |
33 QGraphicsItem* parent) : |
34 QGraphicsItem* parent) : |
34 HbLabel(parent),mServices(services) |
35 HbLabel(parent),mServices(services) |
35 { |
36 { |
36 setAlignment(Qt::AlignCenter); |
37 setAlignment(Qt::AlignCenter); |
37 setFontSpec(HbFontSpec(HbFontSpec::Secondary)); |
38 grabGesture(Qt::TapGesture); |
38 setPlainText("Reg plugin"); |
|
39 } |
39 } |
40 |
40 |
41 /*! |
41 /*! |
42 Destructor |
42 Destructor |
43 */ |
43 */ |
44 CalenPluginLabel::~CalenPluginLabel() |
44 Q_DECL_EXPORT CalenPluginLabel::~CalenPluginLabel() |
45 { |
45 { |
46 } |
46 } |
47 |
47 |
|
48 |
48 /*! |
49 /*! |
49 To handle mouse press event. |
50 Functo listen for all gestures |
50 \sa QGraphicsItem |
51 */ |
51 */ |
52 void CalenPluginLabel::gestureEvent(QGestureEvent *event) |
52 void CalenPluginLabel::mousePressEvent(QGraphicsSceneMouseEvent* event) |
|
53 { |
53 { |
54 Q_UNUSED(event); |
54 if(HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) { |
55 |
55 if (gesture->state() == Qt::GestureFinished) { |
56 mServices.IssueCommandL(ECalenRegionalPluginTapEvent); |
56 if (gesture->tapStyleHint() == HbTapGesture::Tap) { |
|
57 // Regional label is tapped |
|
58 mServices.IssueCommandL(ECalenRegionalPluginTapEvent); |
|
59 event->accept(Qt::TapGesture); |
|
60 } |
|
61 } |
|
62 } |
57 } |
63 } |
58 |
64 |
|
65 |
59 // End of file --Don't remove this. |
66 // End of file --Don't remove this. |