PDA

View Full Version : QPainter in console apps?



Funklord
12th April 2006, 12:28
Is it possible to use QPainter and QPaintDevice classes in a console app?

First, I was getting the error "cannot connect to X server" when trying to run the app from a script (which is correct, there is no X server to connect to)

When I rebuild the program as a console app using QCoreApplication instead of QApplication I get a segfault when accessing these classes.

Why do I ask?
Because a lot of the documentation points to the possibility that QPainter may not work without X since it may require portions of it at runtime for font rendering etc?
(However, this does seem ridiculous, since a lot of things these classes are useful for, aren't GUI oriented at all)

wysota
12th April 2006, 14:41
Is it possible to use QPainter and QPaintDevice classes in a console app?

Not without an X-server connection. It's a limitation of Qt. Let's hope it'll be lifter or an alternative approach for painting on QImage will be introduced.

Funklord
18th April 2006, 14:03
Hmm.. I will have to draw things manually then..
I hope at least QImage will work without X11... else I need to do bitmap/png routines as well. :(

I'll go on a search spree for an easily packagable font renderer
This is the hardest part IMO since the fonts that need to be rendered are not known beforehand, so it needs to support just about all font types.