[Qt-interest] drawing to an off-screen buffer with QPainter/QImage without a QApplication?

william.crocker at analog.com william.crocker at analog.com
Wed Jan 6 15:44:56 CET 2010


>> The thing to try is to try to derive from QCoreApplication. But I don't think that will work because it doesn't provide any painters. But, you don't need any painters QApplication would provide (since you're writing to file, you need to set the color depth and other device metrics yourself when you cerate the durface (QImage/QPixmap) ). If QCoreApplication won't work, then just do what you said, and make a QApplication but just don't show() any dialogs. I also think this will have the side effect of giving you a command prompt immediately.
>>     
>
> Yeah, seems to work with making a QCoreApplication. At least on Windows.
>
>   

I believe the potential problem with this is that (under X11) creation 
of a QApplication
requires the existence of (and connection to) an X-Server which may not 
exist if you
are running your app on some sort of compute server.

Many GUI based apps (like mine) have modes where content can be rendered
"off-line". One should not need to connect to an X11 server to do this.

Bill



More information about the Qt-interest-old mailing list