Zikoel
17th September 2011, 16:55
Hi,
I have a custom class that implements QGraphicsView and I have reimplemented the metods:
void Cavas::mousePressEvent(QMouseEvent *e){
qDebug()<<"Pressed";
}
void Canvas::mouseMoveEvent(QMouseEvent *e){
qDebug()<<"Moved";
}
The second method work correctly but the first don't work... what I can wrong??
Added after 1 35 minutes:
Sorry I have found the solution. I have write a wrond declaration in che ".h" file, I have write:
void mousePressEvent(QMouseEvent event);
instead of
void mousePressEvent(QMouseEvent *event);
Then I have created a new method than can't proces the event.
I have a custom class that implements QGraphicsView and I have reimplemented the metods:
void Cavas::mousePressEvent(QMouseEvent *e){
qDebug()<<"Pressed";
}
void Canvas::mouseMoveEvent(QMouseEvent *e){
qDebug()<<"Moved";
}
The second method work correctly but the first don't work... what I can wrong??
Added after 1 35 minutes:
Sorry I have found the solution. I have write a wrond declaration in che ".h" file, I have write:
void mousePressEvent(QMouseEvent event);
instead of
void mousePressEvent(QMouseEvent *event);
Then I have created a new method than can't proces the event.