Opened 11 years ago

Closed 11 years ago

#36 closed task (fixed)

Port QPrintEngine and QPrinterInfo

Reported by: Dmitry A. Kuminov Owned by:
Priority: blocker Milestone: Qt 4.6.2
Component: QtGui Version: 4.5.1 Beta 1
Severity: high Keywords:


Provide the OS/2 version of the QPrintEngine and QPrinterInfo classes.

Change History (11)

comment:1 Changed 11 years ago by Silvan Scherrer

Severity: high

comment:2 Changed 11 years ago by Dmitry A. Kuminov

Milestone: Qt EnhancedQt 4.6.1
Priority: majorblocker

This is the main part of implementing the printer support.

comment:3 Changed 11 years ago by Dmitry A. Kuminov

I adopted the code to use CUPS on OS/2 but it links against libcups.a which unfortunately uses pthreads. Seems to be one more external dependency... Will try to get one at the Paul's page.

comment:4 Changed 11 years ago by Dmitry A. Kuminov

Okay, I got printing work through CUPS. The only other issue besides the pthread dependency is that sending PDF data to CUPS doesn't work in eCUPS (although according to the Qt sources, it should work since CUPS version 1.2 and provides version 1.3). I forcefully cause it to use the PostScript? mode so far. Will need to clarify the details with Paul.

comment:5 Changed 11 years ago by Dmitry A. Kuminov

Another problem that I found is that an attempt to perform any print operation leaves a temporary file in %TEMP% containing raw PostScript? data that is sent to CUPS. The file remains locked until the Qt application terminates. I couldn't find any code in Qt responsible for that so I suspect that libcups.a is in charge of that. Paul, could you please comment on that too?

comment:6 Changed 11 years ago by Dmitry A. Kuminov

Please discard the previous comment. It turned out to be the vendor bug. Fixed in r574.

comment:7 Changed 11 years ago by Dmitry A. Kuminov

Enabled printing support by default (run configure.cmd as usual). Here's the new bits from README.OS2 on the prerequisites:

  - eCUPS 1.3.11 or later to support printing in Qt. The eCUPS WPI is available
    at:   or

    Linking against eCUPS also requires pthread.lib:
  - Install the eCUPS WPI archive to enable printing support. If this WPI is
    installed, the Qt build system will pick up all necessary libraries
    automatically. Otherwise, you will need to use the following environment
    variables to tell it where to look for CUPS:

      set CUPS_INCLUDEPATH=X:\Path\to\CUPS\include
      set CUPS_LIBS=X:\Path\to\CUPS\lib\libcups.a

    Note that if the eCUPS WPI is not installed and these variables are not set,
    printing support will be completely disabled in the resulting Qt build.

    You will also need to make sure that pthread.lib is placed somewhere in your
    system library path so that the compiler can find it.

comment:8 Changed 11 years ago by psmedley

ok I see the 'Empty Print file' when trying to print a pdf too - will investigate now

comment:9 Changed 11 years ago by psmedley

of course, then, I enable debug logging in cups and try again, and the damn pdf prints

comment:10 Changed 11 years ago by Dmitry A. Kuminov

I see :) BTW, is it a big deal to provide cups.dll instead of libcups.a? It is really preferable to link to CUPS dynamically because it allows for transparent CUPS updates w/o rebuilding Qt.

comment:11 Changed 11 years ago by Dmitry A. Kuminov

Resolution: fixed
Status: newclosed

The primary task is done so closing this defect. Created #141 to track remaining problems with CUPS.

Note: See TracTickets for help on using tickets.