| 119 | } |
| 120 | |
| 121 | QSize ExpandingDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const |
| 122 | { |
| 123 | const QModelIndex sourceIndex = model()->mapToSource(index); |
| 124 | QSize s = QItemDelegate::sizeHint(option, index); |
| 125 | if (model()->isExpanded(sourceIndex) && model()->expandingWidget(sourceIndex)) { |
| 126 | QWidget* widget = model()->expandingWidget(sourceIndex); |
| 127 | QSize widgetSize = widget->size(); |
| 128 | |
| 129 | s.setHeight(widgetSize.height() + s.height() + 10); //10 is the sum that must match exactly the offsets used in ExpandingWidgetModel::placeExpandingWidgets |
| 130 | } else if (model()->isPartiallyExpanded(sourceIndex) != ExpandingWidgetModel::ExpansionType::NotExpanded) { |
| 131 | s.setHeight(s.height() + 30 + 10); |
| 132 | } |
| 133 | return s; |
| 134 | } |
| 135 | |
| 136 | void ExpandingDelegate::adjustStyle(const QModelIndex& index, QStyleOptionViewItem& option) const |
| 137 | { |
nothing calls this directly
no test coverage detected