--- a/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp Fri Sep 03 16:31:27 2010 +0300
+++ b/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp Tue Sep 28 14:03:54 2010 +0300
@@ -21,6 +21,7 @@
// User includes
#include "seccodeedit.h"
#include <../../inc/cpsecplugins.h>
+#include <QGesture>
// ======== MEMBER FUNCTIONS ========
@@ -45,6 +46,10 @@
void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
RDEBUG("0", 0);
+ RDEBUG("Nothing to do because QTapGesture did it", 0);
+ event->ignore();
+ return;
+ /*
if (event->button() != Qt::LeftButton) {
event->ignore();
return;
@@ -56,4 +61,20 @@
} else {
event->ignore();
}
+ */
}
+
+void SecCodeEdit::gestureEvent(QGestureEvent *event)
+{
+ RDEBUG("0", 0);
+ if (QTapGesture *tap = (QTapGesture*)event->gesture(Qt::TapGesture)) {
+ switch(tap->state()) {
+ case Qt::GestureStarted:
+ RDEBUG("0", 0);
+ emit clicked();
+ break;
+ default:
+ break;
+ }
+ }
+}