[Interest] QBuffer::seek warnings in QtConcurrent

Igor Mironchik igor.mironchik at gmail.com
Tue Jan 27 12:32:35 CET 2015


Hi.

I found that next code:

//! Load images future watcher.
QFutureWatcher< QImage > * futureWatcher;
//! Current index for loading image.
int currentLoadImageIndex;
//! Future.
QFuture< QImage > future;

QImage loadImage( const QString & fileName, const QSize & maxSize )
{
	QImage image( fileName );

	if( !image.isNull() )
	{
		image = image.scaled( maxSize, Qt::KeepAspectRatio,
			Qt::SmoothTransformation );
	}

	return image;
}

void
WindowPrivate::loadImages()
{
	currentLoadImageIndex = 0;

	if( !imageFiles.isEmpty() )
	{
		future = QtConcurrent::run( loadImage,
			imageFiles.at( currentLoadImageIndex ),
			imageList->maxImageSize() );
		futureWatcher->setFuture( future );
	}
}

void
Window::_q_imageLoaded()
{
	QImage image = d->future.result();

	d->imageList->model()->setData( d->currentLoadImageIndex, image );

	++d->currentLoadImageIndex;

	if( d->currentLoadImageIndex < d->imageList->model()->rowCount() )
	{
		d->future = QtConcurrent::run( loadImage,
			d->imageFiles.at( d->currentLoadImageIndex ),
			d->imageList->maxImageSize() );

		d->futureWatcher->setFuture( d->future );
	}
}

Produces QBuffer::seek warning like this:

QBuffer::seek: Invalid pos: -583168116
QBuffer::seek: Invalid pos: -1123415015

etc...

What is it? Should I care about it?

Thank you.

P.S. I don't use QBuffer anywhere in the application. This warnings is Qt  
internal warnings...

-- 
Best Regards,
Igor Mironchik.



More information about the Interest mailing list