QStyleOptionViewItemV4 is deprecated in Qt5. Replace it with QStyleOptionViewItem.

This commit is contained in:
Mateusz Skowroński 2017-02-12 05:46:07 +01:00
parent 1a8d535263
commit d7541bcd28
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -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);