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

Jason H scorp1us at yahoo.com
Tue Jan 5 16:33:06 CET 2010


You still have to use the GUI library, but you don't need to make a window.

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. 






----- Original Message ----
From: Paul Miller <paul at fxtech.com>
To: QT Interest List <qt-interest at trolltech.com>
Sent: Tue, January 5, 2010 10:07:26 AM
Subject: [Qt-interest] drawing to an off-screen buffer with QPainter/QImage without a QApplication?

I have a console app and I want to be able to create a QImage and then 
draw on it with QPainter (Qt 4.5), without creating a GUI app and 
on-screen windows of any kind.

Will this "just work" on Mac, Windows, and Linux?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      




More information about the Qt-interest-old mailing list