KPrinter::pageSize() never changes in 3.1.4

Todd Shoemaker jtshoe11 at yahoo.com
Thu Oct 9 11:13:57 CEST 2003


Hello-

It appears that KPrinter::pageSize() will always return the same value
no matter what is selected in KPrinter::setup().  So if I choose A4 in
setup(), pageSize() always remains Letter on my machine.  This occurs
on several different installs of KDE 3.1.4.  I built my version from
source.  I tested this code on a previous version (3.1-15 RH9) and the
pageSize did update.  QPrinter works fine.  And, this doesn't appear to
affect the printing at all.  I can print 3x5 pages in Kate, and it
looks OK in the preview, so it must just be the wrapper call
pageSize().  Here's the code snippet:

-----------------------------------------

KPrinter kprinter;
if (kprinter.setup())
{
  cerr << "KPrinter name: " << kprinter.printerName() << "\n";
  cerr << "KPrinter page size: " <<
pageSizeToPageName(kprinter.pageSize()) << "\n";
}

QPrinter qprinter;
if (qprinter.setup())
{
  cerr << "QPrinter name: " << qprinter.printerName() << "\n";
  cerr << "QPrinter page size: " <<
pageSizeToPageName((KPrinter::PageSize)qprinter.pageSize()) << "\n";
}

-----------------------------------------

I always get the same pageSize() with the kprinter code block in 3.1.4.
 Looking at the kprinter.cpp code, it appears that what may be
happening is that the QMap does not have the key value it is asking
for, so the default is always returned.  

-Todd Shoemaker


More information about the kde-print mailing list