Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2007
QImage question


Message 1 in thread

Hi all,

Can I assume that if QImage::load() fails, QImage::isNull() will return
true ?

TIA

Alain

--
 [ signature omitted ] 

Message 2 in thread

On 11/4/07, denebet <denebet@xxxxxxxxxxxx> wrote:
> Hi all,
>
> Can I assume that if QImage::load() fails, QImage::isNull() will return
> true ?

I doubt it, unless you know the QImage was also null before the `load'
call. I would expect that if the QImage contained an image before the
failed load attempt, it would still contain the original image
afterwards. The attached test program supports this, although the
documentation doesn't seem to say one way or another.

-- 
 [ signature omitted ] 

Attachment: main.cpp
Description: Binary data


Message 3 in thread

Andrew Medico wrote:

> I doubt it, unless you know the QImage was also null before the `load'
> call. I would expect that if the QImage contained an image before the
> failed load attempt, it would still contain the original image
> afterwards. The attached test program supports this, although the
> documentation doesn't seem to say one way or another.

Thanks.

Alain

--
 [ signature omitted ]