From 503dfe46045262e6fae66a78e4ff68f5c1e3d554 Mon Sep 17 00:00:00 2001 From: tanjing Date: Wed, 19 Apr 2023 11:45:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug#159313=20listview=E5=9C=A8=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=90=8E=E4=BC=9Arepaint,=E4=B8=8E=E6=96=87=E7=AE=A1?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8E=E5=9D=90=E6=A0=87=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=85=B1=E5=90=8C=E4=BD=9C=E7=94=A8=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E9=97=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp b/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp index 62f0560..bdd80ce 100644 --- a/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp +++ b/ukui-styles/qt5-style-ukui/qt5-ukui-style.cpp @@ -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;