[Interest] Very vague QML ListView issue

Mark markg85 at gmail.com
Thu May 24 01:20:46 CEST 2012


Hi,

I'm trying to make a sortable ListView and so far it's progressing nicely
(not finished!). It's quite difficult since drag/drop stuff doesn't really
seem that easy like other stuff is in QML.
What i tried is to make one list view with one mousearea on top of it. Yes,
one mousearea instead of a single mousearea for each element. I did that
because you always have issues anyway and having one big mousearea seems to
be the most logical way for me.

The issue i have is this.
If you press and hold your mouse on one of the colored squares and MOVE UP
it works just fine. Even moving down works then.
If you press and hold your mouse on one of the colored squares and MOVE
DOWN then it doesn't work! I can't figure that one out.

What you "should" see is the smaller rectangle should move up and down as
you move the bigger rectangle up and down. I can only get that to work if i
initially move up. If i initially move down then moving down isn't working.
Moving up is always working.

I tried debugging this and it seems like "something" is going wrong with
setting the currentIndex in a ListView. That seems to be going right when
you move up, but wrong when you move down. In QML the code is exactly the
same for both directions.

Here is the code.
http://codepad.org/GajQKdH8

Or if you prefer pastebin:
http://pastebin.com/j9NH6Q70

I hope someone can figure this one out since i'm kinda close at having a
functional and quite clean sortable listview ^_^

Cheers,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120524/24a21d8d/attachment.html>


More information about the Interest mailing list