Talei
2nd July 2011, 19:37
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.
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionButton pb_Style;
pb_Style.state |= QStyle::State_Raised | QStyle::State_Enabled | option.state;
QRect pbRect = option.rect;
...
pb_Style.rect = pbRect;
pb_Style.text = QString();
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.
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.
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyleOptionButton pb_Style;
pb_Style.state |= QStyle::State_Raised | QStyle::State_Enabled | option.state;
QRect pbRect = option.rect;
...
pb_Style.rect = pbRect;
pb_Style.text = QString();
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.