View Full Version : QGraphicScene does not handle mouseDoubleClickEvents

26th April 2012, 19:44
I've got a class that derives form QMainWindow. It's central widget is set to be an instance of DiagramScene that derives from QGraphicScene.
The problem is that as I reimplement mouseDoubleClickEvent in DiagramScene, it does not work.

Here's a snippet:

void DiagramScene::mouseDoubleClickEvent(QGraphicsScene MouseEvent *event)
QList<QGraphicsItem*> items = this->items(event->pos());
if (items.count() > 0 && items.first()->type() == Entity::Type ){
Entity *item = qgraphicsitem_cast<Entity *>(items.first());

It looks for me strange especially because I've reimplemented in DiagramScene other mouse events, such as: mousePressEvent or mouseReleaseEvent and they work well

I spent a lot of time exploring documentation, but I still have no idea why it happens

Thanks in advance!
(Entity is my other class)

26th April 2012, 19:48
Are you sure it doesn't go there? I mean - isn't the message box missing an exec()? Try it with a breakpoint and/or or a qDebug() << "kjkgvkjvf"; if you are not sure.

26th April 2012, 19:56
I'm damn foolish :D That was the issue, of course. Problem is solved. Thanks for help!