Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Remembering the last used printer
QtWS25 Last Chance

[Solved] Remembering the last used printer

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k Views
  • 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 Offline
    A Offline
    Agroni
    wrote on last edited by
    #1

    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
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      [[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
      0
      • A Offline
        A Offline
        Agroni
        wrote on last edited by
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved