From: Manuel Nickschas Date: Tue, 27 Sep 2016 20:28:46 +0000 (+0200) Subject: Avoid deprecation warnings with Qt 5.7 X-Git-Tag: 0.12.5~47 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=e53ecca1883cbf250c3b29c4cb6e50f3c7e66eec;p=quassel.git Avoid deprecation warnings with Qt 5.7 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. (cherry picked from commit 8eab2bd6ca5c9b8de11ed1db6d0900d9c9360a5d) --- diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index cb2ca0bf..76bb2971 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -622,7 +622,11 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c if (!value.isValid()) return QStyledItemDelegate::editorEvent(event, model, option, index); +#if QT_VERSION < 0x050000 QStyleOptionViewItemV4 viewOpt(option); +#else + QStyleOptionViewItem viewOpt(option); +#endif initStyleOption(&viewOpt, index); QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget); diff --git a/src/uisupport/multilineedit.cpp b/src/uisupport/multilineedit.cpp index 3c7f9593..eba27296 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -178,7 +178,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(); +#if QT_VERSION < 0x050000 QStyleOptionFrameV2 opt; +#else + QStyleOptionFrame opt; +#endif opt.initFrom(this); opt.rect = QRect(0, 0, 100, h); opt.lineWidth = lineWidth();