[SailfishDevel] Conditional QML element
E.S. Rosenberg
es.rosenberg+sailfishos.org at gmail.com
Mon Apr 6 22:13:33 UTC 2020
Hi all,
In the application I maintain (gPodder) I would like to show an element
holding Image(s) in each ListItem, depending on whether or not the ListItem
has a property either a component with 2 images or a component with 1 image
should be loaded (an possibly also a no image fallback).
I have tried implementing this using a Loader:
Loader {
id: artArea
anchors {
left: parent.left
}
height: titleItem.height + subtitleItem.height
width: titleItem.height + subtitleItem.height
asynchronous: true
source: episode_art ? "ArtArea.qml" : "CoverArea.qml"
}
However this totally tanks performance, using just "ArtArea" without the
loader is really fast thus the issue is not the amount of images that need
to be loaded.
Is there a better/faster way to do this?
Thanks!
Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20200407/e97ac0e5/attachment.html>
More information about the Devel
mailing list