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:
{
QList<QGraphicsItem*> items = this->items(event->pos());
if (items.count() > 0 && items.first()->type() == Entity::Type ){
Entity *item = qgraphicsitem_cast<Entity *>(items.first());
item->editDialog();
}
}
void DiagramScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
QList<QGraphicsItem*> items = this->items(event->pos());
if (items.count() > 0 && items.first()->type() == Entity::Type ){
Entity *item = qgraphicsitem_cast<Entity *>(items.first());
item->editDialog();
}
}
To copy to clipboard, switch view to plain text mode
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)
Bookmarks