[Qt-qml] ListView and visible items
Adriano Rezende
adriano.rezende at openbossa.org
Thu Feb 3 22:34:25 CET 2011
On Thu, Feb 3, 2011 at 5:58 PM, Juha Turunen <turunen at iki.fi> wrote:
> On Thu, Feb 3, 2011 at 5:39 PM, <jaakko.korpela at nokia.com> wrote:
> delegates should get an insideListViewBounds attached property or
> something (don't know though what the overhead is for cases where it's
> not needed).
I agree. This attached property would be useful and shouldn't impact
in performance if not used.
> If you take into consideration what Adriano said about the coordinates
> you should be able to simplify the logic a bit. Also wouldn't it be
> simpler to organize the logic so that you're checking for
> non-visibility rather than visibility? I mean check that the delegate
> y + height is less than contentY or delegate y is more than the
> content bottom and then do a ! in the onChanged handler.
In deed, it could be simplified to this:
Rectangle {
color: isOutBoundaries ? "blue" : "red"
property bool isOutBoundaries : (y > ListView.view.contentBottom ||
y + height <
ListView.view.contentY)
}
Br,
Adriano
More information about the Qt-qml
mailing list