[Qt-interest] painting widgets in console applications?
Christian Dähn
daehn at asinteg.de
Sat Feb 14 13:24:26 CET 2009
Hi,
I'm doing comparable stuff with Qt console apps.
My app uses QImage as paint device and QPainter to draw directly
into the image. The cool thing with paint devices is: they are all
compatible and can be replaced by QPrinter, QPixmap, QImage and so on.
For console apps you cannot use QPixmap - because under linux/unix
it relies on a X11 specific data type and thus needs X11 to be running.
I use QImage instead and create QApplication with gui disabled flag.
Please don't use QPixmap for generic painting operations, which are not
only for gui output - use QImage instead - this format is more generic and
is much easier to use for all output devices (image file, printer, gui, streams).
Best regards,
Christian Dähn
More information about the Qt-interest-old
mailing list