From d9a1de0ec7e97bb7dee093ec8c881f85886d5406 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 28 Jun 2018 11:13:32 +0400 Subject: [PATCH] Do not use deprecated function --- apps/opencs/view/world/enumdelegate.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/opencs/view/world/enumdelegate.cpp b/apps/opencs/view/world/enumdelegate.cpp index e582e3356..4bd40b830 100644 --- a/apps/opencs/view/world/enumdelegate.cpp +++ b/apps/opencs/view/world/enumdelegate.cpp @@ -110,7 +110,11 @@ void CSVWorld::EnumDelegate::paint (QPainter *painter, const QStyleOptionViewIte int valueIndex = getValueIndex(index); if (valueIndex != -1) { +#if QT_VERSION >= QT_VERSION_CHECK(5,7,0) + QStyleOptionViewItem itemOption(option); +#else QStyleOptionViewItemV4 itemOption(option); +#endif itemOption.text = mValues.at(valueIndex).second; QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &itemOption, painter); }