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

QListView does not allow for Height-for-width of the items

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 4.7.0
    • Widgets: Itemviews
    • None

    Description

      The item delegate (QItemDelegate) does not receive a valid, current cell rect of an item in the model in the sizeHint(). Without this information it is impossible to calculate the height of the size hint if it depends on the width. An example of this is wrapped text.

      This works with QTableView.

      Attached is an example that shows this behavior.

      In the example, resize the columns of the treeview. Then in main() comment the tree view and uncomment the table view and resize columns.

      For the complete discussion, please see [ref:00D26XEw.5002CMl4A:ref ] in support requests.

      PS. I have not checked if QListView or QColumnView send a valid option.rect to the itemDelegate().sizeHint(), but those should be fixed too if they don't. height-for-width is a great feature of the layout system in Qt - it should be part of all itemviews as well.

      Attachments

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

        Activity

          People

            smd Jan Arve
            adamm Adam Majer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes