From: Manuel Nickschas Date: Tue, 27 Sep 2016 20:28:46 +0000 (+0200) Subject: Avoid deprecation warnings with Qt 5.7 X-Git-Tag: travis-deploy-test~363 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8eab2bd6ca5c9b8de11ed1db6d0900d9c9360a5d 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. --- diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index dd1cbaff..0382a214 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -657,7 +657,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 5ace7d6d..31335d1f 100644 --- a/src/uisupport/multilineedit.cpp +++ b/src/uisupport/multilineedit.cpp @@ -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(); +#if QT_VERSION < 0x050000 QStyleOptionFrameV2 opt; +#else + QStyleOptionFrame opt; +#endif opt.initFrom(this); opt.rect = QRect(0, 0, 100, h); opt.lineWidth = lineWidth();