Hi

I try to construct a QPrinter object that is not the default printer. Thus, I first get the correct QPrinterInfo object and pass it as parameter to the constructor of QPrinter. But QPrinter still ends up with the system-wide default printer. Example code fragment:
Qt Code:
  1. printerInfo = QPrinterInfo::printerInfo(QStringLiteral("Farbdrucker"));
  2. qDebug() << "printer selected in printerInfo:" << (printerInfo.isNull() ? tr("not set") : tr("%1 (%2)").arg(printerInfo.printerName()).arg(printerInfo.description()));
  3. QPrinter* printer = new QPrinter(printerInfo /*, QPrinter::HighResolution*/);
  4. qDebug() << "selected printer" << printer->printerName();
To copy to clipboard, switch view to plain text mode 
The output of the two qDebug() ... statements is as follows (unchanged, whether I include the second parameter to QPrinter or not)
Qt Code:
  1. printer selected in printerInfo: "Farbdrucker (Brother HL-4150CDN)"
  2. selected printer "TLP2742"
To copy to clipboard, switch view to plain text mode 
My conclusions: the QPrinterInfo object is constructed and valid (I have named the printer 'Farbdrucker', German for color printer); QPrinterInfo finds the correct description (make and model of my color printer). But the QPrinter object nevertheless uses the default printer (TLP2742).

Where is the issue with my code / thinking?

Versions / OS:
- Ubuntu 12.04 LTS
- Qt 5.4