diff --git a/src/Gui/DAGView/DAGRectItem.cpp b/src/Gui/DAGView/DAGRectItem.cpp index 1558d5a49c71..c4661503d610 100644 --- a/src/Gui/DAGView/DAGRectItem.cpp +++ b/src/Gui/DAGView/DAGRectItem.cpp @@ -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) diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp index 51549970bb0c..0494dc8c3691 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp @@ -320,7 +320,11 @@ class ExpressionDelegate : public QStyledItemDelegate } 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);