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. QT Printing via ubuntu
QtWS25 Last Chance

QT Printing via ubuntu

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.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.
  • K Offline
    K Offline
    knetcozd
    wrote on last edited by
    #1

    I am running QT4 in Ubuntu 10.04 and have a receipt printer , Ubuntu cannot find drivers for my printer however i have the device location /dev/usb/lp0 and i have printed out to the printer using python by treating it as a file.

    How can i print to this printer using QT/C++ without treating it as a file or installing drivers for it on my OS ? ,

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      I am no expert on receipt printers (you did not even give a manufacturer or model), but my guess is: No.

      /dev/usb/lp0 is the device file for a virtual parallel port. It is the only way to talk via that port. So if you need to communicate that way, then there is no way around it. Even if you install drivers those will most likely use that file.

      And with unix "everything is a file" philosophy even drivers tend to provide a file-like interface.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        In CUPS, which is used by Ubuntu too, you can add printers attached to a lp port. You will need a decent driver (PPD file). The printer then can be used throughout the system, including Qt apps.

        If you do not have a PPD you're off to writing to /dev/usb/lp0 directly, using QFile/QDataStream/QTextStream or the like.

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

        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