[vlc-devel] [PATCH 13/13] qt: load QML images asynchronously

Romain Vimont rom1v at videolabs.io
Mon Nov 23 17:30:27 CET 2020


This avoids small freezes of the UI thread.
---
 modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml              | 1 +
 .../gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml    | 1 +
 modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml         | 1 +
 modules/gui/qt/widgets/qml/RoundImage.qml                        | 1 +
 4 files changed, 4 insertions(+)

diff --git a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
index a76acefd7d..367c8f2323 100644
--- a/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
+++ b/modules/gui/qt/medialibrary/qml/ArtistTopBanner.qml
@@ -35,6 +35,7 @@ Widgets.NavigableFocusScope {
 
     Image {
         id: background
+        asynchronous: true
 
         width: parent.width
         height: VLCStyle.artistBanner_height
diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
index 547697dd1f..ed335098cb 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
@@ -78,6 +78,7 @@ Widgets.NavigableFocusScope {
                 /* A bigger cover for the album */
                 Image {
                     id: expand_cover_id
+                    asynchronous: true
                     height: VLCStyle.expandCover_music_height
                     width: VLCStyle.expandCover_music_width
                     source: model.cover || VLCStyle.noArtAlbum
diff --git a/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml b/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
index 7d50a27da7..8f577f12ad 100644
--- a/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
+++ b/modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
@@ -72,6 +72,7 @@ Widgets.NavigableFocusScope {
                     /* A bigger cover for the album */
                     Image {
                         id: expand_cover_id
+                        asynchronous: true
 
                         height: VLCStyle.gridCover_video_height
                         width: VLCStyle.gridCover_video_width
diff --git a/modules/gui/qt/widgets/qml/RoundImage.qml b/modules/gui/qt/widgets/qml/RoundImage.qml
index d45b9c5e1e..b54102db98 100644
--- a/modules/gui/qt/widgets/qml/RoundImage.qml
+++ b/modules/gui/qt/widgets/qml/RoundImage.qml
@@ -23,6 +23,7 @@ import "qrc:///style/"
 
 Image {
     id: cover
+    asynchronous: true
     property real radius: 3
     fillMode: Image.PreserveAspectCrop
     sourceSize: Qt.size(width, height)
-- 
2.29.2



More information about the vlc-devel mailing list