| 46 | } |
| 47 | |
| 48 | QSize AsyncTreeView::sizeHint() const |
| 49 | { |
| 50 | //Assuming that columns are always resized to fit their contents, return a size that will fit all without a scrollbar |
| 51 | QMargins margins = contentsMargins(); |
| 52 | int horizontalSize = margins.left() + margins.right(); |
| 53 | for (int i = 0; i < model()->columnCount(); ++i) { |
| 54 | horizontalSize += columnWidth(i); |
| 55 | } |
| 56 | horizontalSize = qMin(horizontalSize, QGuiApplication::primaryScreen()->geometry().width()*3/4); |
| 57 | return QSize(horizontalSize, margins.top() + margins.bottom() + sizeHintForRow(0)); |
| 58 | } |
| 59 | |
| 60 | void AsyncTreeView::resizeColumns() |
| 61 | { |
nothing calls this directly
no test coverage detected