Avoid deprecation warnings with Qt 5.7
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 27 Sep 2016 20:28:46 +0000 (22:28 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 27 Sep 2016 20:28:46 +0000 (22:28 +0200)
The versioned QStyleOption derivatives are deprecated in Qt 5,
and Qt 5.7 actually gets noisy about that. So remove these by
the unversioned class names.

src/uisupport/bufferview.cpp
src/uisupport/multilineedit.cpp

index dd1cbaf..0382a21 100644 (file)
@@ -657,7 +657,11 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c
     if (!value.isValid())
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
     if (!value.isValid())
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
+#if QT_VERSION < 0x050000
     QStyleOptionViewItemV4 viewOpt(option);
     QStyleOptionViewItemV4 viewOpt(option);
+#else
+    QStyleOptionViewItem viewOpt(option);
+#endif
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
index 5ace7d6..31335d1 100644 (file)
@@ -185,7 +185,11 @@ void MultiLineEdit::updateSizeHint()
 
     // use the style to determine a decent size
     int h = qMin(qMax((int)document()->size().height() + scrollBarHeight, minPixelHeight), maxPixelHeight) + 2 * frameWidth();
 
     // use the style to determine a decent size
     int h = qMin(qMax((int)document()->size().height() + scrollBarHeight, minPixelHeight), maxPixelHeight) + 2 * frameWidth();
+#if QT_VERSION < 0x050000
     QStyleOptionFrameV2 opt;
     QStyleOptionFrameV2 opt;
+#else
+    QStyleOptionFrame opt;
+#endif
     opt.initFrom(this);
     opt.rect = QRect(0, 0, 100, h);
     opt.lineWidth = lineWidth();
     opt.initFrom(this);
     opt.rect = QRect(0, 0, 100, h);
     opt.lineWidth = lineWidth();