[Qt-interest] QPainter segmentation fault on Linux

Srdjan Todorovic todorovic.s at googlemail.com
Fri Feb 20 12:48:34 CET 2009


Hi,

2009/2/20 Srdjan Todorovic <todorovic.s at googlemail.com>:
> 2009/2/20 Davide <davide83 at gmail.com>:
> I'd have expected you to have run a debugger by now.
> Have you found anything of note with a debugger?
>
>> This is my code:
>>   qImage = new QImage((u8*)Image.data, Image.width, Image.height,
>> QImage::Format_RGB32);

How big is Image.data?
  Is it a valid pointer?
What value is Image.width?
What value is Image.height?

>>   QPainter p;
>>   p.begin(qImage);
>>   p.setPen((Qt::GlobalColor)(Qt::cyan));
>>   p.drawRect(2, 2, 20, 20);   //  -->   Segmentation Fault

Have you checked to see what QPainter::drawRect() does internally?

Have you checked to see if you have a segfault on another Linux machine?
Does this code work reliably on a different (earlier) version of Qt?

Srdjan



More information about the Qt-interest-old mailing list