| 62 | } |
| 63 | |
| 64 | int FocusedTreeView::sizeHintForColumn(int column) const |
| 65 | { |
| 66 | QModelIndex i = indexAt(QPoint(0, 0)); |
| 67 | if (i.isValid()) { |
| 68 | QSize hint = sizeHintForIndex(i); |
| 69 | int maxWidth = hint.width(); |
| 70 | if (hint.height()) { |
| 71 | //Also consider one item above, because else we can get problems with |
| 72 | //the vertical scroll-bar |
| 73 | for (int a = -1; a < (height() / hint.height()) + 1; ++a) { |
| 74 | QModelIndex current = i.sibling(i.row() + a, column); |
| 75 | QSize tempHint = sizeHintForIndex(current); |
| 76 | if (tempHint.width() > maxWidth) |
| 77 | maxWidth = tempHint.width(); |
| 78 | } |
| 79 | } |
| 80 | return maxWidth; |
| 81 | } |
| 82 | return columnWidth(column); |
| 83 | } |
| 84 | |
| 85 | void FocusedTreeView::fitColumns() |
| 86 | { |