Fix warnings about QStyleFrameOptionsV4

This commit is contained in:
Gaute Lindkvist 2019-03-12 15:29:08 +01:00
parent edc6dad0f7
commit 925747b9d4
2 changed files with 8 additions and 0 deletions

View File

@ -117,7 +117,11 @@ bool PdmUiTableViewDelegate::isEditorOpen() const
//--------------------------------------------------------------------------------------------------
void PdmUiTableViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
#if QT_VERSION_MAJOR > 4
QStyleOptionViewItem viewItemOption(option);
#else
QStyleOptionViewItemV4 viewItemOption(option);
#endif
QVariant fgText = index.data(Qt::ForegroundRole);

View File

@ -164,7 +164,11 @@ private:
QRect r = rect();
QPalette pal = palette();
#if QT_VERSION_MAJOR > 4
QStyleOptionFrame panel;
#else
QStyleOptionFrameV2 panel;
#endif
initStyleOption(&panel);
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);