MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / focusCurrentFile

Method focusCurrentFile

src/plugins/project/mainframe/projecttree.cpp:357–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357void 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
374void ProjectTree::setAutoFocusState(bool state)
375{

Callers 1

addAutoFocusSwitcherMethod · 0.80

Calls 5

modelClass · 0.85
indexMethod · 0.45
isValidMethod · 0.45
isEmptyMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected