Tests: Fix query for child index

If the p here is invalid, child() gives the wrong result (never use
child()).
wilder
Stephen Kelly 9 years ago
parent 7f4de58f75
commit 0dbeb3fb64
  1. 2
      autotests/kselectionproxymodeltest.cpp

@ -857,7 +857,7 @@ void KSelectionProxyModelTest::removeRows()
{
QObject::connect(&tree, &QAbstractItemModel::rowsAboutToBeRemoved, &tree,
[&tree, &selectionModel](QModelIndex const& p, int s, int e){
auto rmIdx = p.child(s, 0);
auto rmIdx = tree.index(s, 0, p);
if (s == e && selectionModel.selectedIndexes().contains(rmIdx))
{
auto nextIdx = tree.index(e + 1, 0, rmIdx.parent());

Loading…
Cancel
Save