Reputation: 12864
By default QPainter
has its origin point in top-left corner.
I want to draw shapes but all coordinates that I have are in cartesian system.
So my question - how can I change the origin point to bottom-left corner?
Sure, I can scale(1,-1)
but then drawText()
also scaled and prints inverted text. All I nee it just move origin point.
Upvotes: 2
Views: 4954
Reputation: 37697
QPainter painter(this);
painter.translate(this.rect().bottomLeft());
painter.scale(1.0, -1.0);
Upvotes: 4
Reputation: 2231
You can use void QPainter::translate ( const QPointF & offset )
method to change origin coordinate. Check docs here.
Upvotes: 3