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

Provide boolean properties to know if a delegate is the first/last item in a view

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.7
    • None
    • All

    Description

      For styling purposes, it would sometimes be useful to know if a delegate is the first or last item in a view. Currently, the only way  to determine if a delegate is the first is by comparing its index to 0, which doesn't work reliably inside ItemDelegate styling since index may not be available when using required properties. Determining the last delegate is even harder since it requires comparing index to the ListView's count.

      I would expose this in a way similar to isCurrentItem, by adding properties to the view attached type. For ListView this is straightforward, basically isFirstItem and isLastItem. For other views this might be a little more tricky since you might want to know if the delegate is first/last in a row/column.

      Attachments

        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
            awhiemstra Arjen Hiemstra
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes