If you don't want to derive from QWidget to use as a custom viewport, you could use an event filter.
See QObject::eventFilter().
Cheers,
_
If you don't want to derive from QWidget to use as a custom viewport, you could use an event filter.
See QObject::eventFilter().
Cheers,
_
Why don't you just overwrite the resizeEvent of the QGraphicsView if that's all you want to get notified of?
If that's all the OP wants, then using an event filter as anda_skoa suggests avoids the need to derive a new class from QGraphicsView just to handle resizeEvent().Why don't you just overwrite the resizeEvent of the QGraphicsView if that's all you want to get notified of?
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Not so much an objection as an observation that there are many ways to skin Qt cats. Event filters are one of the more difficult things to understand about Qt event processing, whereas deriving a class and overriding a virtual method is straightforward.Your objection is valid
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Hi All,
Thanks for the replies, Using the event handler has worked for me. I did not want to subclass my dialog box if I didn't need to. Wanted to know when ever the viewport location changed within a scene ( scrolling, dragging, scaling, resize, etc) this worked for me.
Thanks!
Bookmarks