Unexpected results with KPrinter and QPaintDeviceMetrics

Chris Howells chris at chrishowells.co.uk
Fri Dec 27 19:32:02 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

On Friday 27 December 2002 16:08, Chris Howells wrote:

> KPrinter printer;
> printer.setup();
> QPaintDeviceMetrics metrics(&printer);
> kdDebug() << "X DPI " << metrics.logicalDpiX() << endl;
> kdDebug() << "Y DPI " << metrics.logicalDpiY() << endl;
> kdDebug() << "Height mm " << metrics.heightMM() << endl;
> kdDebug() << "Width mm " << metrics.widthMM() << endl;

OK, changing it to something like:

KPrinter printer;
printer.setup();
QPainter painter(&printer);
QPaintDeviceMetrics metrics(painter.device());

Seems to fix it... not entirely sure that I understand why.

- -- 
Cheers, Chris Howells -- chris at chrishowells.co.uk, howells at kde.org
Web: http://chrishowells.co.uk, PGP key: http://chrishowells.co.uk/pgp.txt
KDE: http://www.koffice.org, http://printing.kde.org, http://usability.kde.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQE+DKq2F8Iu1zN5WiwRAuxFAKCfOGr++O8HymykT4avt1BBaaZsswCeIEqv
7xFrdTUFj3AFkNFUgfu40uM=
=32MX
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list