[Qt-interest] QPainter segmentation fault on Linux

Davide davide83 at gmail.com
Fri Feb 20 11:42:18 CET 2009


On Thu, Feb 19, 2009 at 6:10 PM, Srdjan Todorovic
<todorovic.s at googlemail.com> wrote:
> I'd say it's still a bad idea, probably a bad design approach. Wont it
> be better to just keep a pointer member and then alloc your QImage
> where you assign it?

First of all thanks for your hints, I changed my program in the way
you suggest me.

Unfortunately my problems on a Linux system still remain.
Does anybody have an idea of what can cause a Segmentation Fault error
when I call drawRect method only on a Linux system and not in Windows?

This is my code:
   qImage = new QImage((u8*)Image.data, Image.width, Image.height,
QImage::Format_RGB32);
   QPainter p;
   p.begin(qImage);
   p.setPen((Qt::GlobalColor)(Qt::cyan));
   p.drawRect(2, 2, 20, 20);   //  -->   Segmentation Fault
   p.end();

Thanks
-- 
Davide



More information about the Qt-interest-old mailing list