@Mark: Sorry, that was probably a bit confusing. ;-)
What I meant was the following: Whenever a new batch of images are received
I resize and compress them a little bit to create thumbnails. After the
images are resized and compressed, they are added to the ListModel. That's
the part, that is
Hi,
I don't quite follow.
First you say you implemented our suggestions (move image processing in a
thread), then you say: "all operations are performed in the main (GUI)
thread"... Exactly the opposite of what we've been suggesting.
If i'm reading your reply correctly you're not offloading
Yes - it's possible to move QImage processing to another thread. I've used
QtConcurrent::run() to resize and write several images concurrently.
void SomeClass::_writeImage( QImage inImage, const QString )
{
QFuture future = QtConcurrent::run( [this, inImage, inPath] () {
QImage image
you should avoid any time consuming ops in his thread
On Aug 13, 2017 22:40, "Bernhard B" wrote:
> Many thanks guys!
>
> I just implemented your suggestions and have to say that the scrolling
> performance definitely improved a lot. Thanks a lot for your help!
>
> However,
Many thanks guys!
I just implemented your suggestions and have to say that the scrolling
performance definitely improved a lot. Thanks a lot for your help!
However, as I am now doing more work (compress image + resize) before I
populate the Listmodel, I noticed that there is a significant lag
I've been using jpeg - something like this (where MAX_THUMB_DIM is 60):
void _saveThumbnail( QImage inImage, const QString )
{
QImage image = inImage.scaled( MAX_THUMB_DIM, MAX_THUMB_DIM,
Qt::KeepAspectRatio, Qt::SmoothTransformation );
QImageWriter writer( inPath, "JPEG" );
You need to do the "heavy" image operations in a separate thread!
Copy the result back to the main thread and feed it to QML.
You should not do any more operations on it once it lives in the main
thread (no resize, scale, colorize, whatever) as you will notice that
during scrolling.
On Fri, Aug
Hi Andy,
many thanks for your response! I am also using a QAbstractListModel-derived
class that gets exposed to the QML world which contains the images.
Yesterday I started to resize the images before feeding them to the
ListModel. According to the QML Profiler the delegate gets now created a
Bernhard:
I don't use QML, but in my application I use a QAbstractItemModel-derived
class and a QTreeView-derived class to display image thumbnails in the
view. The way I make it speedy is to save the image as a thumbnail so the
view items don't need to resize the image data at all.
Maybe you
Hi Vlad,
you mean the QQuickAsyncImageProvider? That one sounds really promising.
Will definitely try that out. Many thanks for the suggestion!
Bernhard
Am Donnerstag, 10. August 2017 schrieb Vlad Stelmahovsky :
> threaded image provider might help
>
> On Thu, Aug 10, 2017 at 12:36 PM,
threaded image provider might help
On Thu, Aug 10, 2017 at 12:36 PM, Bernhard B wrote:
> Hi,
>
> yesterday, I also tried to replace the Base64ImageProvider approach with a
> subclassed QQuickPaintedItem which paints the image in it's paint method. I
> imagined that this
Hi,
yesterday, I also tried to replace the Base64ImageProvider approach with a
subclassed QQuickPaintedItem which paints the image in it's paint method. I
imagined that this approach might be faster es no bade64 decoding needs to
be done. But unfortunately it looks like as it's performing even
12 matches
Mail list logo