equal
deleted
inserted
replaced
17 |
17 |
18 #include "cpremotelockdataformviewitem.h" |
18 #include "cpremotelockdataformviewitem.h" |
19 #include <hblabel.h> |
19 #include <hblabel.h> |
20 #include <QGraphicsSceneMouseEvent> |
20 #include <QGraphicsSceneMouseEvent> |
21 #include <../../inc/cpsecplugins.h> |
21 #include <../../inc/cpsecplugins.h> |
22 |
22 #include <QGesture> |
23 |
23 |
24 /* |
24 /* |
25 ***************************************************************** |
25 ***************************************************************** |
26 * Name : CpRemoteLockDataFormViewItem |
26 * Name : CpRemoteLockDataFormViewItem |
27 * Parameters : QGraphicsItem* |
27 * Parameters : QGraphicsItem* |
114 ***************************************************************** |
114 ***************************************************************** |
115 */ |
115 */ |
116 CpLockEdit::CpLockEdit(const QString &text, QGraphicsItem *parent /*= 0*/) |
116 CpLockEdit::CpLockEdit(const QString &text, QGraphicsItem *parent /*= 0*/) |
117 : HbLineEdit(text,parent) |
117 : HbLineEdit(text,parent) |
118 { |
118 { |
|
119 RDEBUG("0", 0); |
|
120 grabGesture(Qt::TapGesture); |
|
121 grabGesture(Qt::PanGesture); |
|
122 grabGesture(Qt::PinchGesture); |
|
123 grabGesture(Qt::SwipeGesture); |
|
124 |
119 } |
125 } |
120 |
126 |
121 |
127 |
122 /* |
128 /* |
123 ***************************************************************** |
129 ***************************************************************** |
142 ***************************************************************** |
148 ***************************************************************** |
143 */ |
149 */ |
144 void CpLockEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) |
150 void CpLockEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) |
145 { |
151 { |
146 RDEBUG("0", 0); |
152 RDEBUG("0", 0); |
|
153 RDEBUG("Nothing to do because QTapGesture did it", 0); |
|
154 event->ignore(); |
|
155 return; |
|
156 |
|
157 /* |
147 if (event->button() != Qt::LeftButton) { |
158 if (event->button() != Qt::LeftButton) { |
148 event->ignore(); |
159 event->ignore(); |
149 return; |
160 return; |
150 } |
161 } |
151 |
162 |
153 emit clicked(); |
164 emit clicked(); |
154 event->accept(); |
165 event->accept(); |
155 } |
166 } |
156 else { |
167 else { |
157 event->ignore(); |
168 event->ignore(); |
158 } |
169 } |
|
170 */ |
159 } |
171 } |
|
172 |
|
173 void CpLockEdit::gestureEvent(QGestureEvent *event) |
|
174 { |
|
175 RDEBUG("0", 0); |
|
176 if (QTapGesture *tap = (QTapGesture*)event->gesture(Qt::TapGesture)) { |
|
177 switch(tap->state()) { |
|
178 case Qt::GestureStarted: |
|
179 RDEBUG("0", 0); |
|
180 emit clicked(); |
|
181 break; |
|
182 default: |
|
183 break; |
|
184 } |
|
185 } |
|
186 } |