QGraphicsScene borders ?
-
wrote on 26 Jun 2016, 16:12 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 ;)
-
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 ;)
wrote on 26 Jun 2016, 16:56 last edited by Joel BodenmannAs far as I know there is no "built-in" way to do this.
My approach would be to create fourQGraphicsLineItem
s and arrange them along the borders of the scene.
If you want them to be invisible you can simply set the opacity to 0. -
As far as I know there is no "built-in" way to do this.
My approach would be to create fourQGraphicsLineItem
s and arrange them along the borders of the scene.
If you want them to be invisible you can simply set the opacity to 0.wrote on 26 Jun 2016, 16:59 last edited by@Joel-Bodenmann
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 .
2/3