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

Igor Mironchik igor.mironchik at gmail.com
Mon Aug 31 21:49:22 CEST 2015


Hi,

On 31.08.2015 22:42, Alexey Godko wrote:
> just check QPixmap::isNull()

Pixmap is not null... Image was saved for the half and I read it... 
Pixmap successfully loaded but draws only first part of the image while 
the next one is grey...

>
> 2015-08-31 22:35 GMT+03:00 Igor Mironchik <igor.mironchik at gmail.com 
> <mailto:igor.mironchik at gmail.com>>:
>
>     Hi,
>
>     On 31.08.2015 21 <tel:31.08.2015%2021>: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 <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>
>

-- 
Best Regards,
Igor Mironchik.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150831/05851b10/attachment.html>


More information about the Interest mailing list