Sorry, missed your request... it's something like:
// Set world coordinates to millimetres.
QTransform t = QTransform::fromScale (
painter->device()->physicalDpiX() / 25.4,
painter->device()->physicalDpiY() / 25.4 );
painter->setWorldTransform(t, false);
// Set world coordinates to millimetres.
QTransform t = QTransform::fromScale (
painter->device()->physicalDpiX() / 25.4,
painter->device()->physicalDpiY() / 25.4 );
painter->setWorldTransform(t, false);
To copy to clipboard, switch view to plain text mode
or you could just play with the painter window:
// For portrait A4 paper in millimetres
painter->setWindow(0, 0, 210, 297);
// For portrait A4 paper in millimetres
painter->setWindow(0, 0, 210, 297);
To copy to clipboard, switch view to plain text mode
You need to be careful because the transforms will scale everything. You can also use the QTransform without changing the painter.
Bookmarks