Hi!
By default point 0.0 at top left corner. How to make the lower left corner as 0.0?
Attachment 11603Attachment 11604
Printable View
Hi!
By default point 0.0 at top left corner. How to make the lower left corner as 0.0?
Attachment 11603Attachment 11604
You can use QGraphicsScene::setSceneRect(QRectF),. It will set logical coordinates you want.
Ex : if your scene geomerty is 0,0, width , height
I think what you can do is :Code:
scene->setSceneRect(0, heigh, width, -height);
Thank you for reply.
I tried, not working.
Attachment 11606Quote:
self.ui.graphicsView.scene = QtWidgets.QGraphicsScene()
self.ui.graphicsView.setScene(self.ui.graphicsView .scene)
self.ui.graphicsView.scene.setSceneRect(0, 650, 500, -650)
self.ui.graphicsView.setRenderHints(QPainter.Antia liasing)
path = QPainterPath()
path.moveTo(20.0, 20.0)
path.lineTo(50, 20)
path.moveTo(20.0, 20.0)
path.lineTo(20, 50)
self.ui.graphicsView.scene.addPath(path)
No more ways to do this?
You could try a transformation.
Translate to the bottom left point and scale with 1/-1
Cheers,
_
Do you have example how to do this?