[Qt-qml] No mouse events in C++ QML element

Jason H scorp1us at yahoo.com
Fri Nov 18 20:18:01 CET 2011


I think there is an interactive flag that is off by default, and then you will only get mouse events when a button is down. There is another flag that lets you get events without a button being down.



________________________________
 From: Harri Pasanen <harri at mpaja.com>
To: qt-qml at qt.nokia.com 
Sent: Friday, November 18, 2011 12:42 PM
Subject: [Qt-qml] No mouse events in C++ QML element
 
Hi,

I'm trying to get mouse events in my QML plugin.

In my class inherited from QDeclarativeItem I implement the following 
virtual functions:

     void paint(QPainter *painter, const QStyleOptionGraphicsItem *, 
QWidget *widget = 0);
     void mousePressEvent(QGraphicsSceneMouseEvent *e);
     void mouseMoveEvent(QGraphicsSceneMouseEvent *e);
     void mouseReleaseEvent(QGraphicsSceneMouseEvent *e);

and the paint() is called and my widget is rendered ok.  But for some 
reason I receive no mouse events.

I'm inclined to think I'm missing something really simple, like toggling 
a flag somewhere.

Any hints what might be wrong?

Harri
_______________________________________________
Qt-qml mailing list
Qt-qml at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20111118/be99ffe8/attachment.html 


More information about the Qt-qml mailing list