MCPcopy Create free account
hub / github.com/MrKepzie/Natron / autoCompleteFileName

Method autoCompleteFileName

Gui/SequenceFileDialog.cpp:1645–1679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1643}
1644
1645void
1646SequenceFileDialog::autoCompleteFileName(const QString & text)
1647{
1648 if ( text.startsWith( QLatin1String("//") ) || text.startsWith( QLatin1Char('\\') ) ) {
1649 _view->selectionModel()->clearSelection();
1650
1651 return;
1652 }
1653 QStringList multipleFiles = typedFiles();
1654 if (multipleFiles.count() > 0) {
1655 QModelIndexList oldFiles = _view->selectionModel()->selectedRows();
1656 QModelIndexList newFiles;
1657 for (int i = 0; i < multipleFiles.count(); ++i) {
1658 QModelIndex idx = _model->index( multipleFiles.at(i) );
1659 if ( oldFiles.contains(idx) ) {
1660 oldFiles.removeAll(idx);
1661 } else {
1662 newFiles.append(idx);
1663 }
1664 }
1665
1666 _view->selectionModel()->blockSignals(true);
1667
1668 if ( _selectionLineEdit->hasFocus() ) {
1669 for (int i = 0; i < oldFiles.count(); ++i) {
1670 _view->selectionModel()->select(oldFiles.at(i), QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
1671 }
1672 }
1673
1674 for (int i = 0; i < newFiles.count(); ++i) {
1675 select( newFiles.at(i) );
1676 }
1677 _view->selectionModel()->blockSignals(false);
1678 }
1679}
1680
1681void
1682SequenceFileDialog::onLookingComboboxChanged(const QString & /*path*/)

Callers

nothing calls this directly

Calls 7

atMethod · 0.80
appendMethod · 0.80
clearSelectionMethod · 0.45
countMethod · 0.45
indexMethod · 0.45
containsMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected