update src/findresultwin.cpp.

Item.model()->index(i, 0, Item)代替Item.child(i, 0)
消除警告,更新用法。
This commit is contained in:
XiaoPb 2023-02-21 13:44:05 +00:00 committed by Gitee
parent da61adb9a2
commit 2eae8163e0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
#include "findresultwin.h"
#include "findresultwin.h"
#include "findwin.h"
#include "common.h"
#include "styleset.h"
@ -208,12 +208,12 @@ void FindResultWin::slot_selectAll()
//遍历下面的子节点
int i = 0;
QModelIndex childMi;
childMi = sectionItem.child(i, 0);
childMi = sectionItem.model()->index(i, 0, sectionItem);
while (childMi.isValid())
{
++i;
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
childMi = sectionItem.child(i, 0);
childMi = sectionItem.model()->index(i, 0, sectionItem);
}
return i+1;
};
@ -226,12 +226,12 @@ void FindResultWin::slot_selectAll()
//遍历根节点下面每一个section
{
int i = 0;
QModelIndex section = rootItem.child(i, 0);
QModelIndex section = rootItem.model()->index(i, 0, rootItem);
while (section.isValid() && !section.data(ResultItemEditor).isNull())
{
++i;
selectCount += selectSection(section);
section = firstRootItem.child(i, 0);
section = firstRootItem.model()->index(i, 0, firstRootItem);
}
}
@ -255,12 +255,12 @@ void FindResultWin::slot_selectSection()
//遍历下面的子节点
int i = 0;
QModelIndex childMi;
childMi = sectionItem.child(i, 0);
childMi = sectionItem.model()->index(i, 0, sectionItem);
while (childMi.isValid())
{
++i;
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
childMi = sectionItem.child(i, 0);
childMi = sectionItem.model()->index(i, 0, sectionItem);
}
return i+1;
};