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. QPrintDialog with custom list of printers
Forum Updated to NodeBB v4.3 + New Features

QPrintDialog with custom list of printers

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 869 Views 1 Watching
  • 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
    Atropos
    wrote on last edited by
    #1

    Is there a way to pop up a QPrintDialog with a pulldown menu consisting of a custom list of printers?

    By default, it appears that QPrintDialog comes up with a list of printers generated from QPinterInfo.availablePrinters(). This in turn (I think) gets its list of printers from the /etc/printcap file created by CUPS on linux systems.

    Unfortunately, at my lab, the machines that I run my applications on are all CUPS clients and not the server themselves, and so the printcap file never gets generated locally and the printers don't show up in Qt. Its possible that there's a workaround for this as well in Qt, but I haven't been able to figure one out yet.

    From the terminal, "lpstat -a" shows all of the available printers on the network properly, and so my idea was to simply use this to generate the list of printers and pass that to the dialog for the pulldown, but I'm not sure how to override that widget for this. I'd really rather not re-invent the wheel by making a whole new custom widget.

    Any ideas would be most appreciated. Thanks!

    Using:
    OS: Red Hat Linux 5
    Qt: 4.8.5
    Python: 2.7.4
    PyQt: 4.10.1
    SIP: 4.14.7

    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