QStyledItemDelegate paint QPushButton with stylesheet
Hello,
I struggle with painting QPushButton with inherited styleSheet in custom delegate.
Delegate parent is TreeView with styleSheet.
The way I paint it in my QStyledItemDelegate.
Code:
{
pb_Style.
state |
= QStyle::State_Raised |
QStyle::State_Enabled | option.
state;
QRect pbRect
= option.
rect;
...
pb_Style.rect = pbRect;
style
->drawControl
(QStyle::CE_PushButton,
&pb_Style, painter, qobject_cast<QWidget
*>
(this
->parent
()) );
}
In short I don't know how to paint QPushButton with inherited styleSheet from the view.
Any suggestions are more then welcome.
Re: QStyledItemDelegate paint QPushButton with stylesheet
SOLVED:
Paint actual widget does the trick, my bad.
Re: QStyledItemDelegate paint QPushButton with stylesheet
Quote:
Originally Posted by
Talei
SOLVED:
Paint actual widget does the trick, my bad.
Can you explain exactly what you mean by this? Perhaps with an example?
I am seeing a similar problem with a QProgressBar not being painted with the stylesheet set on my QTreeWidget within my QStyledItemDelegate even though the stylesheet works fine for true QProgressBar widgets.