Don't use deprecated Qt features
This commit is contained in:
parent
f4143a6eb1
commit
1dbb15dd1c
|
@ -459,7 +459,7 @@ void MainWindow::selectNextFile(QItemSelectionModel *selectionModel, const QMode
|
|||
return;
|
||||
} else {
|
||||
// files and subdirectories have been fetched already
|
||||
next = currentIndex.child(0, currentIndex.column());
|
||||
next = currentIndex.model()->index(0, currentIndex.column(), currentIndex);
|
||||
}
|
||||
}
|
||||
if (!next.isValid()) {
|
||||
|
|
|
@ -563,9 +563,6 @@
|
|||
<property name="plainText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="tabStopWidth">
|
||||
<number>15</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -237,7 +237,7 @@ void printModelIndex(const QModelIndex &index, QString &res, int level)
|
|||
res += data;
|
||||
}
|
||||
const auto nextInCol = index.sibling(index.row(), index.column() + 1);
|
||||
const auto child = index.child(0, 0);
|
||||
const auto child = index.model()->index(0, 0, index);
|
||||
const auto next = index.sibling(index.row() + 1, 0);
|
||||
if (nextInCol.isValid()) {
|
||||
printModelIndex(nextInCol, res, level);
|
||||
|
|
|
@ -15,7 +15,8 @@ FilteredFileSystemItemModel::FilteredFileSystemItemModel(ItemStatus statusFilter
|
|||
|
||||
bool FilteredFileSystemItemModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
const auto sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
const auto *const sourceModel = this->sourceModel();
|
||||
const auto sourceIndex = sourceModel->index(sourceRow, 0, sourceParent);
|
||||
if (!sourceIndex.isValid()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -31,12 +32,12 @@ bool FilteredFileSystemItemModel::filterAcceptsRow(int sourceRow, const QModelIn
|
|||
return false;
|
||||
}
|
||||
|
||||
auto child = sourceIndex.child(0, 0);
|
||||
auto child = sourceModel->index(0, 0, sourceIndex);
|
||||
while (child.isValid()) {
|
||||
if (filterAcceptsRow(child.row(), sourceIndex)) {
|
||||
return true;
|
||||
}
|
||||
child = sourceIndex.child(child.row() + 1, 0);
|
||||
child = sourceModel->index(child.row() + 1, 0, sourceIndex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue