[Development] Missing documentation makes QML ListView unusable
Alan Alpert
416365416c at gmail.com
Mon Jan 28 19:37:30 CET 2013
On Mon, Jan 28, 2013 at 12:36 AM, Rainer Keller <rainer.keller at digia.com> wrote:
> Hi,
>
>
>
> I tried to use a QML ListView and wondered why it does not react to mouse
> clicks. After looking into the examples I found out that you need to add a
> MouseArea in the delegate. Without this code the ListView is unusable
> because the user can not select anything using the mouse.
>
>
>
> Shouldn't the MouseArea be the default behaviour without writing this code
> every time? Only if the user wants to do custom things he should need to
> override this.
No. ListView is designed to support many interaction methods, not a
specific interaction method with others being "custom things". Aside
from the case where you want more than click-to-select in your
MouseArea (which is probably the most common case, and would require
overriding any default MouseArea), there's the case where the center
item remains selected (and selection changes when the list scrolls),
the case where the device has no pointer (and MouseAreas are just a
waste) and the case where selection is not used (again, waste). Having
a MouseArea "by default" would most likely lead to it being disabled
in the majority of cases, on all platforms except desktop.
If you want something that provides conveniently the default user
experience expected for a specific platform, look to the platform
components instead of the GUI primitives. This argument will be a lot
stronger once we finish the desktop components of course, but we're
working on it :) .
>
>
>
> The documentation seems to contain no statements about the MouseArea needed.
> This is essential for the usability and it should be mentioned in ListView
> the documentation at least.
This is a different problem (probably easiest solved with a link to
the examples, like Laszlo suggested). Because there's a lot of value
in running and playing with the examples, there are a lot of simple
examples in the examples directory for QtQuick which would probably be
better classified as snippets and integrated better in the
documentation. But doing that makes them a lot harder to run right
now, so they're left in the examples directory. Practical upshot being
that to be introduced to most of the QtQuick items you'll need to flip
through the examples directory, which shouldn't be too hard even
though it might be a different workflow for some.
--
Alan Alpert
More information about the Development
mailing list