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;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// files and subdirectories have been fetched already
|
// files and subdirectories have been fetched already
|
||||||
next = currentIndex.child(0, currentIndex.column());
|
next = currentIndex.model()->index(0, currentIndex.column(), currentIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!next.isValid()) {
|
if (!next.isValid()) {
|
||||||
|
|
|
@ -563,9 +563,6 @@
|
||||||
<property name="plainText">
|
<property name="plainText">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabStopWidth">
|
|
||||||
<number>15</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -237,7 +237,7 @@ void printModelIndex(const QModelIndex &index, QString &res, int level)
|
||||||
res += data;
|
res += data;
|
||||||
}
|
}
|
||||||
const auto nextInCol = index.sibling(index.row(), index.column() + 1);
|
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);
|
const auto next = index.sibling(index.row() + 1, 0);
|
||||||
if (nextInCol.isValid()) {
|
if (nextInCol.isValid()) {
|
||||||
printModelIndex(nextInCol, res, level);
|
printModelIndex(nextInCol, res, level);
|
||||||
|
|
|
@ -15,7 +15,8 @@ FilteredFileSystemItemModel::FilteredFileSystemItemModel(ItemStatus statusFilter
|
||||||
|
|
||||||
bool FilteredFileSystemItemModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
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()) {
|
if (!sourceIndex.isValid()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -31,12 +32,12 @@ bool FilteredFileSystemItemModel::filterAcceptsRow(int sourceRow, const QModelIn
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto child = sourceIndex.child(0, 0);
|
auto child = sourceModel->index(0, 0, sourceIndex);
|
||||||
while (child.isValid()) {
|
while (child.isValid()) {
|
||||||
if (filterAcceptsRow(child.row(), sourceIndex)) {
|
if (filterAcceptsRow(child.row(), sourceIndex)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
child = sourceIndex.child(child.row() + 1, 0);
|
child = sourceModel->index(child.row() + 1, 0, sourceIndex);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue