[SailfishDevel] Conditional QML element
Alexey Andreyev
yetanotherandreyev at gmail.com
Tue Apr 7 17:19:12 UTC 2020
Hello! I could be wrong, but I've probably faced BackgroundItem as the
freezes reason (ListItem inherits BackgroundItem) the other day with the
Silica's ListView.
I could recommend to try fallback to Item and MouseArea from ListItem and
BackgroundItem accordingly and check is that true. Just a hint from my side
what to check twice, I would be glad to hear about the results is that the
case.
вт, 7 апр. 2020 г. в 18:52, E.S. Rosenberg <
es.rosenberg+sailfishos.org at gmail.com>:
> Hi David,
> You are absolutely correct, this is the better solution which runs at a
> reasonable speed (though I expect it consumes more memory).
> Thanks!
> Eli
> PS - so far I have never really profiled the application for memory usage
> or tried to do so, does the SDK have some way of doing this?
>
> Op di 7 apr. 2020 om 11:55 schreef David Llewellyn-Jones <
> david at flypig.co.uk>:
>
>> Hi Eli,
>>
>> I'm probably misunderstanding the situation, but can you make individual
>> items visible or not (visible: true/false), rather than using Loaders in
>> the list?
>>
>> David
>>
>> On 07/04/2020 11:22, E.S. Rosenberg wrote:
>> > Hi Andrey,
>> > Thanks for the suggestion, though having them as Components in the same
>> > file instead of external qml files does improve performance it is still
>> > a lot slower then just having the component directly in use without a
>> > Loader.
>> >
>> > ie:
>> >
>> > ListItem {
>> > (...)
>> > ArtArea {
>> > }
>> > }
>> >
>> > Of course like that there is no logic to have either ArtArea or
>> > CoverArea but I can have logic in each ArtArea as to which image it is
>> > displaying so image loading an logic speed are not the issue but rather
>> > just the loader (I can have 400+ length lists where you really see the
>> > slowdown).
>> >
>> > Any other suggestions?
>> > Thanks!
>> > Eli
>> >
>> > Op di 7 apr. 2020 om 01:15 schreef Андрей Кожевников
>> > <coderusinbox at gmail.com <mailto:coderusinbox at gmail.com>>:
>> >
>> > wrap inside Component and set using sourceComponent property
>> >
>> > вт, 7 апр. 2020 г. в 01:13, E.S. Rosenberg
>> > <es.rosenberg+sailfishos.org at gmail.com
>> > <mailto:es.rosenberg%2Bsailfishos.org at gmail.com>>:
>> >
>> > 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
>> > _______________________________________________
>> > SailfishOS.org Devel mailing list
>> > To unsubscribe, please send a mail to
>> > devel-unsubscribe at lists.sailfishos.org
>> > <mailto:devel-unsubscribe at lists.sailfishos.org>
>> >
>> > _______________________________________________
>> > SailfishOS.org Devel mailing list
>> > To unsubscribe, please send a mail to
>> > devel-unsubscribe at lists.sailfishos.org
>> > <mailto:devel-unsubscribe at lists.sailfishos.org>
>> >
>> >
>> > _______________________________________________
>> > SailfishOS.org Devel mailing list
>> > To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>> >
>>
>>
>> --
>> Website: https://www.flypig.co.uk
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to
> devel-unsubscribe at lists.sailfishos.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20200407/7a4db2cf/attachment.html>
More information about the Devel
mailing list