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

Usage of QAbstractItemDelegate::sizeHintChanged() unclear.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.8.3
    • Documentation
    • None

    Description

      QAbstractItemDelegate::sizeHintChanged() is non-const, and thus cannot be emitted from QAbstractItemDelegate::paint(), which is the only place in the virtual API that makes sense to emit it.

      I assume the signal should be emitted when painting and the drawables do not fit in the QStyleOption-provided rect, or the rect is too big.

      Otherwise, it seems I must directly connect the signal to some custom signal in my model subclass, but using the model directly from the delegate seems inappropriate for MVC.

      My specific use case involves painting multiple rows of data into the item rect, and the number of rows varies as the input changes. My model is emitting dataChanged() appropriately, but this only triggers a repaint of the new data in the old rect.

      What is the intended usage of this signal? Or should it be const so that it may be emitted from paint()?

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            dlonie David Lonie
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes