Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Remembering the last used printer

    General and Desktop
    2
    3
    1364
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Agroni last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

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

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • A
          Agroni last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post