mirror of https://gitee.com/cxasm/notepad--.git
update src/findresultwin.cpp.
Item.model()->index(i, 0, Item)代替Item.child(i, 0) 消除警告,更新用法。
This commit is contained in:
parent
da61adb9a2
commit
2eae8163e0
|
@ -1,4 +1,4 @@
|
||||||
#include "findresultwin.h"
|
#include "findresultwin.h"
|
||||||
#include "findwin.h"
|
#include "findwin.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "styleset.h"
|
#include "styleset.h"
|
||||||
|
@ -208,12 +208,12 @@ void FindResultWin::slot_selectAll()
|
||||||
//遍历下面的子节点
|
//遍历下面的子节点
|
||||||
int i = 0;
|
int i = 0;
|
||||||
QModelIndex childMi;
|
QModelIndex childMi;
|
||||||
childMi = sectionItem.child(i, 0);
|
childMi = sectionItem.model()->index(i, 0, sectionItem);
|
||||||
while (childMi.isValid())
|
while (childMi.isValid())
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
|
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
|
||||||
childMi = sectionItem.child(i, 0);
|
childMi = sectionItem.model()->index(i, 0, sectionItem);
|
||||||
}
|
}
|
||||||
return i+1;
|
return i+1;
|
||||||
};
|
};
|
||||||
|
@ -226,12 +226,12 @@ void FindResultWin::slot_selectAll()
|
||||||
//遍历根节点下面每一个section
|
//遍历根节点下面每一个section
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
QModelIndex section = rootItem.child(i, 0);
|
QModelIndex section = rootItem.model()->index(i, 0, rootItem);
|
||||||
while (section.isValid() && !section.data(ResultItemEditor).isNull())
|
while (section.isValid() && !section.data(ResultItemEditor).isNull())
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
selectCount += selectSection(section);
|
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;
|
int i = 0;
|
||||||
QModelIndex childMi;
|
QModelIndex childMi;
|
||||||
childMi = sectionItem.child(i, 0);
|
childMi = sectionItem.model()->index(i, 0, sectionItem);
|
||||||
while (childMi.isValid())
|
while (childMi.isValid())
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
|
ui.resultTreeView->selectionModel()->select(childMi, QItemSelectionModel::Select);
|
||||||
childMi = sectionItem.child(i, 0);
|
childMi = sectionItem.model()->index(i, 0, sectionItem);
|
||||||
}
|
}
|
||||||
return i+1;
|
return i+1;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue