[Qt-interest] Creating QPixmap from QByteArray causes segfault [SOLVED]
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Wed May 5 13:16:19 CEST 2010
On Wed, May 5, 2010 at 4:42 PM, <Oliver.Knoll at comit.ch> wrote:
> Mandeep Sandhu wrote on Wednesday, May 05, 2010 12:35 PM:
>
>> ...
>> Initially I thought adding CONFIG += gui in the pro file would be
>> enough. But that wasn't the case.
>
> Correct: only if you really instantiate a QApplication (instead of just QCoreApplication) is the graphics subsystem properly initialised, and only then you can use QPixmap (which uses the same pixel setup as set in the graphic card and such), QWidget and any other GUI-related class. QPixmap (QPainter...) interfaces the native drawing subsystem (DirectDraw etc.), and this must be properly initialised (by instantiating a QApplication object).
>
> QImage on the other hand does not depend on any hardware, and thus can be used within a "QCoreApplication".
Ok, I didn't know that. Thanks for clearing it though.
Regards,
-mandeep
>
> Cheers, Oliver
> --
> Oliver Knoll
> Dipl. Informatik-Ing. ETH
> COMIT AG - ++41 79 520 95 22
> _______________________________________________
> 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