Is there any chance to find out the size of the QPainter
? I am using QPainter
for drawing the whole graphic interface for a mobile app. The problem is that certain application overlay the window with menu which size is different for every device, thus making things nearly impossible!
Are there any possibilities to do it instead of knowing QPainter
size?
EDIT: simple width()
and height()
works!
QPainter is the class used to perform drawing operations. QPaintDevice represents a device that can be painted on using a QPainter . QPaintEngine provides the interface that the painter uses to draw onto different types of devices.
You can use this: QPainter painter(this); painter. setPen(Qt::yellow); painter. drawText(0, 20, "One"); painter.
You have to look at the size of the QPaintDevice attached to the QPainter
painter->device()->width();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With