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

Allow centering checkbox in itemviews

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0
    • Widgets: Itemviews
    • None
    • All

      It would be nice to have the possibility to center-align a checkbox in an itemview. Currently the checkbox is always drawn left no matter if there is additional text or decoration.

      This feature is often asked in the forum. Herean example on how it would look like created with a test implementation:

      The first row is with text (no behavior change), the other three without text and AlignHCenter/AlignLeft/AlignRight with the new behavior.

      Here the old behavior:

       

      The question is how to pass the alignment information to the view. Currently I'm misusing the TextAlignmentRole since the alignment of the checkbox / decoration only works when there is no text. Also adding two new alignments may conflict with e.g. QStyleOptionViewItem::decorationPosition then.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            chehrlic Christian Ehrlicher
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes