Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-90447

can interact with ListView delegates outside ListView bounds, even if hidden via layer.enabled

    XMLWordPrintable

Details

    Description

      According to QTBUG-9951 and others, we consider it normal that ListView doesn't visually clip its delegates unless you set clip: true; and it keeps a "spare" delegate past each end, to be ready to smoothly drag into the viewport.

      If that spare delegate contains something interactive like MouseArea or an event handler, you can interact with it even though it's completely outside the bounds of the ListView itself. Not sure if that's a bug or not; it's probably always been that way. If you set clip: true, then you can no longer interact with it: so that's nicely in sync, it's absent both visually and from being an event delivery target.

      An ususual way of clipping though is to set layer.enabled: true. In that case, you can interact with something that you can't see. The items are visible, enabled, and are not culled: those are the 3 things we check in QQuickWindow during delivery. But you can't see them.

      In the attached example, you can toggle the layer.enabled property, and either way you can click anywhere in the delegate to the right, even though it's outside the ListView AND you might not be able to see part of it.

      Checking yet another thing to determine visibility during event delivery doesn't sound like a good idea to me, unless it replaces one of the old ways.

      Another possible solution would be to check the ListView bounds; but in general we don't check each item's parent's bounds. Probably there are many cases when an Item is used as a placeholder to set the location of its children, but the children go outside, both visually and interactively. In general, the parent can even be zero-size.

      So perhaps this isn't really a bug, just unexpected... anyway one workaround is to set clip: true; another is to put something on top.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes