[Qt-interest] Segmentation fault in QPixmap::fromImage()
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Sat Apr 2 06:44:06 CEST 2011
> How can I tell what type of application is it?
What do you instantiate in your main method...QApplication or QCoreApplication?
-mandeep
>
> I think that this should work, because it does work for some images, but not
> others, which is the weird part
>
> -----Original Message-----
> From: Mandeep Sandhu [mailto:mandeepsandhu.chd at gmail.com]
> Sent: Thu 3/31/2011 11:30 PM
> To: Cole, Derek
> Cc: qt-interest at qt.nokia.com
> Subject: Re: [Qt-interest] Segmentation fault in QPixmap::fromImage()
>
> On Fri, Apr 1, 2011 at 4:06 AM, Cole, Derek <dcole at integrity-apps.com>
> wrote:
>> Hello, I am getting a segmentation fault at the last line of this snippet.
>>
>>
>> QImage qi(lutData, imwidth,imheight, QImage::Format_Indexed8);
>>
>> /*...some code to call qi.setColor() to populate the LUT..*/
>>
>> QPixmap p(QPixmap::fromImage(qi,Qt::AutoColor));
>>
>> What could be the cause of this? My program just simply "unexpectedly
>> finishes" and the debugger shows it down in the QPixmap lib somewhere..but
>> I
>> cant see it obviously
>
> Is this a QApplication or a QCoreApplication? One needs an instance of
> QApp to initialize the GUI subsystem.
>
> I had a similar issue when trying to create a pixmap of data read from
> a n/w interface while i was using only a QCoreApplication. Not usre if
> the same applies to you.
>
> -mandep
>
>>
>> Thanks
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>>
>
>
More information about the Qt-interest-old
mailing list