Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.3
-
None
Description
Setting decorationAlignment to center on QStyleOptionViewItem in item delegate does not work for an icon (it's still aligned left)
Does not matter if text is shown or not.
Example is below. All other properties (e.g. decorationPosition, decorationSize work properly)
class LabelEditDelegate : public QStyledItemDelegate
...
void LabelEditDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const
{
QStyleOptionViewItem option2(option);
option2.decorationAlignment = Qt::AlignHCenter | Qt::AlignVCenter;
QStyledItemDelegate::paint(painter, option2, index);
}