Qt & printing

holle at almaden.ibm.com holle at almaden.ibm.com
Tue Oct 19 18:33:28 BST 1999



>From man 7 signal :
Signal   Value    Action    Comment
-----------------------------
(...)
SIGPIPE 13      A           Broken Pipe: write to pipe with no readers
(...)

see that "no readers" that means, that the "other side" -> lpr has closed the
conection. It only means, that QPrinter did not close it or did not close it
early enough.
Send a Ctrl-D at the end of the printout and see if QPrinter closes the pipe or
delete the object. Check QPrinter docs and source to see if any special
character, like EOF (Ctrl-D), closes the pipe :-)
If everything fails, set up a signal handler for SIGPIPE that does nothing (may
be print a message). Remember to re-register the signal handler after every
usage, you can do this in the signal handler itself.

- holger

pezz at tkwcy.ee (Peeter Russak ) on 19/10/99 07:07:38

Please respond to kdevelop at barney.cs.uni-potsdam.de

To:   kdevelop at barney.cs.uni-potsdam.de
cc:
Subject:  Qt & printing




Hi!

It's not actually a kdevelop-related question, but your are the guys, who
actually use Qt every day and so know most of it's bugs.
Is it a known bug, that printing with QPrinter into PostScript printer gives
always a broken pipe error? Tried with Qt 2.0.1, 2.0.2 and 2.1.0-19991009. All
ended in Broken pipe. Printing into file does the right thing.
BTW Qt-s drawdemo example crashes the same way as my program. I'm using RedHat
6.1. If answer is positive, then does anybody know workaround for this problem?

Last things strace tells me are:
write(6, "\n%%Pages: ", 10)             = 10
write(6, "1", 1)                        = 1
write(6, "\n%%DocumentFonts: ", 18)     = 18
write(6, "\n%%EndComments\n\n", 16)     = 16
brk(0x80c5000)                          = 0x80c5000
--- SIGCHLD (Child exited) ---
brk(0x80c7000)                          = 0x80c7000
brk(0x80c9000)                          = 0x80c9000
brk(0x80ce000)                          = 0x80ce000
brk(0x80d0000)                          = 0x80d0000
brk(0x80d3000)                          = 0x80d3000
write(6, "% Optimized Qt prolog\n", 22) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) ---
+++ killed by SIGPIPE +++

--
Peeter






More information about the KDevelop mailing list