newAgeOfHelloWorld
newAgeOfHelloWorld

Reputation: 73

Qt. How can I pick default printer and disable the rest of them in QPrinterDialog?

I need to remove or at least disable all printers but one from "Select printer" group. It is QPrintDialog and I know that it is native. I am interested in solution only for Windows.

enter image description here

Upvotes: 0

Views: 363

Answers (1)

Ahed Kabalan
Ahed Kabalan

Reputation: 855

QPrinter printer;
printer.setPrinterName("printer's name");
QPrintDialog dialog(&printer, this);

https://doc.qt.io/qt-5/qprinter.html#setPrinterName

Upvotes: 1

Related Questions