Click to See Complete Forum and Search --> : QCanvasItem events


PhatBarren
05-22-2003, 12:06 AM
Hello,

How can you capture events on a QCanvasItem, for example, if someone clicks on a QCanvasItem, how can I be notified of this. I checked out the API docs, there appear to be no signals for QCanvasItems.

Thanks in advance :)

GaryJones32
05-23-2003, 01:45 AM
yea as far as it looks -- QCanvasItem noes not inherit
QWidget
and QWidget is the class that provides the handlers
for mousePressEvent() and the like
QCanvasEvent doesn't even inherit QObject
only inherits QT namespace and that's it
So i guess it's just designed to do sprite type 2D
and is made light for speed.

check out:

http://zez.org/article/articleprint/2/

he subclasses QCanvasView
(read The docs for QCanvasView)
it inherits QWidget through (qframe->qscrollview)
appearently this is what gets the focus so
you can add mouse event listeners to it

PhatBarren
05-23-2003, 10:22 PM
Nice link, thanks for your help :)

Cheers