[Interest] Sections of a ListView with BottomToTop layout

Kitsune Ral Kitsune.Ral at protonmail.ch
Thu Sep 1 13:42:07 CEST 2016


Hi all,

I'm trying to use a ListView with BottomToTop layout. The use case is a chat application; the BottomToTop layout is very natural for it (in particular, it positions new items exactly how I want them to, without pushing new messages below the bottom edge). However, I've got a problem with ListView sections. I used the following setting when the layout was TopToBottom:
labelPositioning: ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart

Obviously, when I reverse the layout, section labels appear below instead of above, which is not very intuitive (I planned to use them for grouping by date/time). My question is: is there a way to get the labels back above their sections (and stick to the top of the ListView, respectively)? Something like (inexistent yet) InlineLabelsAfter | CurrentLabelAtEnd.
I thought of keeping TopToBottom layout but then I have to do something with scrolling - or, rather, making sure the end of the content doesn't move out of the screen unless I flick it explicitly. If that's an easier task, please advise on it. (I tried to remember the position before updating the model - the code is clumsy and looks fragile.)

I already feel like hacking up my own custom QQuickListView - but it's quite an ordeal (the source code looks, well, complex). Or should I propose a patch to Qt? :)



--
Kitsune Ral
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160901/af601bd4/attachment.html>


More information about the Interest mailing list