fix bug#159313 listview在选中后会repaint,与文管删除后坐标更新共同作用,导致界面闪

This commit is contained in:
tanjing 2023-04-19 11:45:00 +08:00 committed by xibowen
parent be15db684b
commit 503dfe4604
1 changed files with 10 additions and 2 deletions

View File

@ -585,7 +585,15 @@ void Qt5UKUIStyle::polish(QWidget *widget)
if(listview != nullptr)
{
connect(listview->selectionModel(), &QItemSelectionModel::selectionChanged, [listview](const QItemSelection &selected, const QItemSelection &deselected){
listview->repaint();
if(!selected.empty() && !deselected.empty())
{
listview->repaint();
// int row = listview->currentIndex().row();
// int column = listview->currentIndex().column();
// if(listview->indexWidget(listview->model()->index(row, column)))//widget is null
// listview->indexWidget(listview->model()->index(row, column))->repaint();
}
});
}
}
@ -1819,7 +1827,7 @@ void Qt5UKUIStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleO
selectIndexList.append(i);
}
// qDebug() << "selectIndexList...." << selectIndexList;
if(selectIndexList.contains(currentIndex - 1) && selectIndexList.contains(currentIndex +1))
if(selectIndexList.contains(currentIndex - 1) && selectIndexList.contains(currentIndex +1) && selectIndexList.contains(currentIndex))
mid = true;
else if(selectIndexList.contains(currentIndex - 1))
end = true;