From 2bd92ba96433441b12d472202f13891c874f44b2 Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 14 Dec 2023 09:46:30 +0800 Subject: [PATCH] Revert "fix: qapitrace open file crash" This reverts commit b80e65a4f15d3b505324c0daf2acde6a76efceb6. treeview select state paint error (e.g. deepin-system-monitor, deepin-devicemanager) --- styleplugins/chameleon/chameleonstyle.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index cac0cdaf..6814613a 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -208,8 +208,9 @@ void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOpti //QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理 if (qobject_cast(w)) { + const auto &delegate = *qobject_cast(w)->itemDelegate(); //如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角) - if (!qobject_cast(qobject_cast(w)->itemDelegate())) { + if (typeid(delegate) != typeid(QStyledItemDelegate)) { break; } @@ -575,8 +576,9 @@ void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOpti } //这里QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理 if (qobject_cast(w)) { + const auto &delegate = *qobject_cast(w)->itemDelegate(); //如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角) - if (!qobject_cast(qobject_cast(w)->itemDelegate())) { + if (typeid(delegate) != typeid(QStyledItemDelegate)) { break; }