PDA

View Full Version : QApplication on Debian Server because of pdf generation



QtMin
18th April 2014, 09:16
Hello guys,

I need some help. I developed a server application which runs on debian. Because I want to generate some pdfs, I need QPrinter and QPainter, which needs a the QtGui. So I have no QCoreApplication, but a QApplication.
The app runs very well on the dev-machine (ubunut gnome). After deploying on server, the app wasn't startable, but that was expected, because of no xserver instance.
So I installed Xvfb and started it via following script:


XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
echo -n "Stopping virtual X frame buffer: Xvfb"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
echo "."
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
exit 1
esac

exit 0


The Xvfb runs and the server app is startable. But if pdf-generation is needed, there are some warnings and no pdf is generated. The initial warning is QPainter::begin(): Returned false.

Maybe you can put me in the right direction. Are there other args needed, at the start of Xvfb?

thank u