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

Igor Mironchik igor.mironchik at gmail.com
Mon Aug 31 21:35:12 CEST 2015


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.




More information about the Interest mailing list