Skip to content

Commit

Permalink
Revert "fix: qapitrace open file crash"
Browse files Browse the repository at this point in the history
This reverts commit b80e65a.
treeview select state paint error (e.g. deepin-system-monitor, deepin-devicemanager)
  • Loading branch information
kegechen committed Dec 14, 2023
1 parent fee5bb7 commit 933a1b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions styleplugins/chameleon/chameleonstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOpti

//QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理
if (qobject_cast<const QTreeView *>(w)) {
const auto &delegate = *qobject_cast<const QTreeView *>(w)->itemDelegate();
//如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角)
if (!qobject_cast<QStyledItemDelegate *>(qobject_cast<const QTreeView *>(w)->itemDelegate())) {
if (typeid(delegate) != typeid(QStyledItemDelegate)) {
break;
}

Expand Down Expand Up @@ -575,8 +576,9 @@ void ChameleonStyle::drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOpti
}
//这里QTreeView的绘制复制了QCommonStyle的代码,添加了圆角的处理,hover的处理
if (qobject_cast<const QTreeView *>(w)) {
const auto &delegate = *qobject_cast<const QTreeView *>(w)->itemDelegate();
//如果QTreeView使用的不是默认代理 QStyledItemDelegate,则采取DStyle的默认绘制(备注:这里的QtCreator不会有hover效果和圆角)
if (!qobject_cast<QStyledItemDelegate *>(qobject_cast<const QTreeView *>(w)->itemDelegate())) {
if (typeid(delegate) != typeid(QStyledItemDelegate)) {
break;
}

Expand Down

0 comments on commit 933a1b2

Please sign in to comment.