Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QGraphicsScene borders ?
Walux last edited by Walux
Hi Qt community ,
What's the safest and shortest in code way to catch colliding between a QGraphicsItem and the borders of the QGraphicsScene ?
I don't believe that manually declaring the borders one by one is the best way to do it .
Thanks for your comprehension ;)
Joel Bodenmann last edited by Joel Bodenmann
As far as I know there is no "built-in" way to do this.
My approach would be to create four
QGraphicsLineItems and arrange them along the borders of the scene.
If you want them to be invisible you can simply set the opacity to 0.
Walux last edited by
That's the manual way i talked about uptop but thanks anyways :)
It reassures me that i'm not "re-inventing" the wheel by applying this method .