[Solved] Remembering the last used printer

  • In a corporate environment there are hundreds of printers on the network. Everyone has a default printer for printing regular stuff. But, I am building an application for a special kind of a printer. My application can never print to the default printer. Therefore I need to choose that special printer every single time.

    How can I find out what printer did the user choose on the QPrintDialog.

    And, how can I change the pre-selected printer in QPrintDialog?

    I am also interested to implement a QuickPrint feature so that no dialog is shown at all. It just prints to my special printer directly. And my printer is not the default printer.

    How would you implement a QuickPrint feature?

  • [[Doc:QPrintDialog]] returns a [[doc:QPrinter]] object via the printer() method. Use printerName() on the latter.

  • Thank you Volker.

    It looks like the method QPrinter.printerName() returns the name of a real printer only. That's exactly what I am looking for. Just that during testing I was printing to PDF file and the printerName for that was coming as NULL string.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.