File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ class IconViewDelegate : public QItemDelegate
91
91
painter->fillRect (option.rect , option.palette .highlight ());
92
92
painter->setPen (option.palette .highlightedText ().color ());
93
93
} else {
94
- painter->setPen (option.palette .text ().color ());
94
+ QBrush txtBrush = qvariant_cast<QBrush>(index .data (Qt::ForegroundRole));
95
+ painter->setPen (txtBrush.color ());
95
96
}
96
97
97
98
painter->drawPixmap (iconRect, icon.pixmap (iconsize.width (),iconsize.height ()));
@@ -122,7 +123,8 @@ class IconListDelegate : public QItemDelegate
122
123
painter->fillRect (option.rect , option.palette .highlight ());
123
124
painter->setPen (option.palette .highlightedText ().color ());
124
125
} else {
125
- painter->setPen (option.palette .text ().color ());
126
+ QBrush txtBrush = qvariant_cast<QBrush>(index .data (Qt::ForegroundRole));
127
+ painter->setPen (txtBrush.color ());
126
128
}
127
129
128
130
painter->drawPixmap (iconRect, icon.pixmap (iconsize.width (),iconsize.height ()));
You can’t perform that action at this time.
0 commit comments