Aha, that explains a lot... can I easily override this behavior? Or do I have to create my own specialization of a QGraphicsView and override the mouse click events?
Aha, that explains a lot... can I easily override this behavior? Or do I have to create my own specialization of a QGraphicsView and override the mouse click events?
It depends what you want to archieve.If your view does not have to respond at all to mouse clicks then you may instal an event filter on it.But if it does,then you have options:
1.Set appropriate flag on each item (what you want to avoid as I can understand).Thats the option if you're using Qt's graphics items without subclassing them.
2.If you use own items,then you may override mousePressEvent and mouseDoubleClickEvent.You may check inside the state of your scene,and then accept/reject the event
btw-that 'aha' phrase makes me suspicous if you are from Poland?Because I'm Polish,and if it isn't forbidden we may write in Polish.
I have to catch all graphics view clicks, so that isn't an option.
I think this is the best solution to my problem. I'll subclass the graphics view and override these events. I have one question though... I use Qt Creator's GUI designer, so I can't just use my subclassed QGraphicsView, can I? Is there a way to do this properly?
Sorry to disappoint you, but I'm not. 'Aha' is a pretty universal word: http://en.wiktionary.org/wiki/Aha![]()
Bookmarks