QStyleOptionViewItemV4 is deprecated in Qt5. Replace it with QStyleOptionViewItem.
This commit is contained in:
parent
1a8d535263
commit
d7541bcd28
|
@ -46,7 +46,11 @@ void RectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
|
|||
Q_UNUSED(widget);
|
||||
painter->save();
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
QStyleOptionViewItem styleOption;
|
||||
#else
|
||||
QStyleOptionViewItemV4 styleOption;
|
||||
#endif
|
||||
|
||||
styleOption.backgroundBrush = backgroundBrush;
|
||||
if (editing)
|
||||
|
|
|
@ -320,7 +320,11 @@ protected:
|
|||
}
|
||||
|
||||
void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const {
|
||||
#if QT_VERSION >= 0x050000
|
||||
QStyleOptionViewItem options = option;
|
||||
#else
|
||||
QStyleOptionViewItemV4 options = option;
|
||||
#endif
|
||||
initStyleOption(&options, index);
|
||||
|
||||
options.widget->style()->drawControl(QStyle::CE_ItemViewItem, &options, painter);
|
||||
|
|
Loading…
Reference in New Issue
Block a user