_Jack_
24th April 2010, 21:51
Hi to all,
I want to draw and print some basic shapes like squares and I need the way to use millimeter unit in natural way.
For example I need to print an exact 10 * 10 mm square
I expect to print a square starting a t x=20 mm, y =20 mm with 10 mm side.. .but something wrong about dimension of printer output.
Could someone please put me in the rigth way or provide a little example about conversion to the measure unit used in Qpainter and the unit used in Printer?
Many thanks in advance.
this is the code I'm using:
QPrinter printer(QPrinter::HighResolution);
printer.setResolution(600);
printer.setPaperSize(QPrinter::A4);
printer.setOrientation (QPrinter::Portrait);
printer.setNumCopies(1);
QPainter painter;
painter.begin(&printer);
painter.drawRect(20,20,10,10);
painter.end();
I want to draw and print some basic shapes like squares and I need the way to use millimeter unit in natural way.
For example I need to print an exact 10 * 10 mm square
I expect to print a square starting a t x=20 mm, y =20 mm with 10 mm side.. .but something wrong about dimension of printer output.
Could someone please put me in the rigth way or provide a little example about conversion to the measure unit used in Qpainter and the unit used in Printer?
Many thanks in advance.
this is the code I'm using:
QPrinter printer(QPrinter::HighResolution);
printer.setResolution(600);
printer.setPaperSize(QPrinter::A4);
printer.setOrientation (QPrinter::Portrait);
printer.setNumCopies(1);
QPainter painter;
painter.begin(&printer);
painter.drawRect(20,20,10,10);
painter.end();