| 355 | } |
| 356 | |
| 357 | void ProjectTree::focusCurrentFile() |
| 358 | { |
| 359 | QModelIndex root = d->itemModel->index(0, 0); |
| 360 | if (!root.isValid()) { |
| 361 | return; |
| 362 | } |
| 363 | if (d->currentFile.isEmpty()) { |
| 364 | clearSelection(); |
| 365 | return; |
| 366 | } |
| 367 | QModelIndexList indices = model()->match(root, Qt::ToolTipRole, d->currentFile, 1, Qt::MatchExactly | Qt::MatchRecursive); |
| 368 | if (!indices.isEmpty()) { |
| 369 | QModelIndex index = indices.first(); |
| 370 | setCurrentIndex(index); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | void ProjectTree::setAutoFocusState(bool state) |
| 375 | { |