| 138 | } |
| 139 | |
| 140 | void FocusedTreeView::rowsAboutToBeInserted(const QModelIndex&, int first, int last) |
| 141 | { |
| 142 | Q_D(FocusedTreeView); |
| 143 | |
| 144 | if (d->insertedBegin == -1) { |
| 145 | d->insertedBegin = d->insertedEnd = first; |
| 146 | |
| 147 | d->wasAtEnd = true; |
| 148 | QModelIndex last = model()->index(model()->rowCount() - 1, 0); |
| 149 | if (last.isValid()) { |
| 150 | auto rect = visualRect(last); |
| 151 | d->wasAtEnd = rect.isValid() && viewport()->rect().intersects(rect); |
| 152 | } |
| 153 | } |
| 154 | if (first == d->insertedEnd) { |
| 155 | d->insertedEnd = last + 1; |
| 156 | } |
| 157 | |
| 158 | if (!d->timer.isActive()) |
| 159 | d->timer.start(); |
| 160 | } |
| 161 | |
| 162 | // Removing rows can make longer rows move into the visible region, so we also must trigger a |
| 163 | // column resize |