PDA

View Full Version : Problem Qt really needs a X server, can't use QCoreApplication...



oscar
4th December 2008, 07:56
Hi,

I get "cannot connect to X server :0.0" which is normal because I don't have a X server on my server.

But when I use QCoreApplication, it says that it needs a QApplication!
It's because I'm using QPainter to paint into a pdf file...
I'm stuck!

Any idea?

Thanks
Best regards,
Oscar

wysota
4th December 2008, 09:31
Most painting operations unfortunately need a QApplication object. I think only painting on QImage doesn't and only if you don't use text rendering (I'm not sure about the last one though). Try painting on QImage and see if that goes through.

oscar
4th December 2008, 09:41
I finally installed a little X Server just for my Qt application.
That's really abnormal but this is the only quick way I found.

I didn't tried drawing on a QImage, that would change to many of my code...

Thanks wysota for your quick reply
Best regards,
Oscar

wysota
4th December 2008, 09:53
I'm sure making a quick test wouldn't have hurt...