[Interest] QFileSystemWatcher and accesing files in monitored directory...

Alexey Godko koloboid at gmail.com
Mon Aug 31 21:42:31 CEST 2015


just check QPixmap::isNull()

2015-08-31 22:35 GMT+03:00 Igor Mironchik <igor.mironchik at gmail.com>:

> Hi,
>
> On 31.08.2015 21:19, Thiago Macieira wrote:
> > On Monday 31 August 2015 20:09:48 Igor Mironchik wrote:
> >> But the same problem exists on my Linux machine, where I don't have any
> >> antiviruses...
> > What's the error message on Linux? If possible, run your application with
> > strace to catch the open call and its return value.
>
> I try to load image with next function.
>
> static inline QPixmap loadPixmap( const QString & path )
> {
>      QPixmap p;
>
>      QFile imgFile( path );
>
>      if( imgFile.open( QIODevice::ReadOnly ) )
>      {
>          p.loadFromData( imgFile.readAll() );
>          imgFile.close();
>
>          qDebug() << "is pixmap null" << p.isNull();
>      }
>      else
>          qDebug() << "Couldn't open image file for reading"
>              << path << "error" << imgFile.errorString()
>              << imgFile.error();
>
>      return p;
> }
>
> On Windows I receive errors like that file is blocked by another
> process. It's normal. If returned pixmap is null i'm trying to reload
> failed image after some timeout.
>
> But on Linux file always opens on reading even if it is incomplete
> yet... It's bad. I receive artifacts in view such as loaded on the half
> images... And I can't check it.
>
> How can I be sure that image loaded completely?
>
> --
> Best Regards,
> Igor Mironchik.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150831/3f665cb4/attachment.html>


More information about the Interest mailing list