equal
deleted
inserted
replaced
19 #include <QGraphicsSceneMouseEvent> |
19 #include <QGraphicsSceneMouseEvent> |
20 |
20 |
21 // User includes |
21 // User includes |
22 #include "seccodeedit.h" |
22 #include "seccodeedit.h" |
23 #include <../../inc/cpsecplugins.h> |
23 #include <../../inc/cpsecplugins.h> |
|
24 #include <QGesture> |
24 |
25 |
25 // ======== MEMBER FUNCTIONS ======== |
26 // ======== MEMBER FUNCTIONS ======== |
26 |
27 |
27 /*! |
28 /*! |
28 Constructor |
29 Constructor |
43 Mouse Press Event |
44 Mouse Press Event |
44 */ |
45 */ |
45 void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) |
46 void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) |
46 { |
47 { |
47 RDEBUG("0", 0); |
48 RDEBUG("0", 0); |
|
49 RDEBUG("Nothing to do because QTapGesture did it", 0); |
|
50 event->ignore(); |
|
51 return; |
|
52 /* |
48 if (event->button() != Qt::LeftButton) { |
53 if (event->button() != Qt::LeftButton) { |
49 event->ignore(); |
54 event->ignore(); |
50 return; |
55 return; |
51 } |
56 } |
52 |
57 |
54 emit clicked(); |
59 emit clicked(); |
55 event->accept(); |
60 event->accept(); |
56 } else { |
61 } else { |
57 event->ignore(); |
62 event->ignore(); |
58 } |
63 } |
|
64 */ |
59 } |
65 } |
|
66 |
|
67 void SecCodeEdit::gestureEvent(QGestureEvent *event) |
|
68 { |
|
69 RDEBUG("0", 0); |
|
70 if (QTapGesture *tap = (QTapGesture*)event->gesture(Qt::TapGesture)) { |
|
71 switch(tap->state()) { |
|
72 case Qt::GestureStarted: |
|
73 RDEBUG("0", 0); |
|
74 emit clicked(); |
|
75 break; |
|
76 default: |
|
77 break; |
|
78 } |
|
79 } |
|
80 } |