From 7e1c0fb1fc3d45c63cbb1c12e75cffc72ed29f0c Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Wed, 5 Sep 2018 11:53:24 +0300 Subject: [PATCH] [kstyle] Fix deprecation warnings Summary: See https://build.kde.org/job/Plasma%20breeze%20kf5-qt5%20FreeBSDQt5.11/4/warnings12Result/ Test Plan: Compiles. Reviewers: #plasma, broulik Reviewed By: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D15285 --- kstyle/breezestyle.cpp | 6 +++++- kstyle/breezewindowmanager.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index ad3ae6d6..da413673 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -3744,7 +3744,11 @@ namespace Breeze const bool hasCustomBackground = viewItemOption->backgroundBrush.style() != Qt::NoBrush && !( state & State_Selected ); const bool hasSolidBackground = !hasCustomBackground || viewItemOption->backgroundBrush.style() == Qt::SolidPattern; + #if BREEZE_USE_KDE4 const bool hasAlternateBackground( viewItemOption->features & QStyleOptionViewItemV2::Alternate ); + #else + const bool hasAlternateBackground( viewItemOption->features & QStyleOptionViewItem::Alternate ); + #endif // do nothing if no background is to be rendered if( !( mouseOver || selected || hasCustomBackground || hasAlternateBackground ) ) @@ -3756,7 +3760,7 @@ namespace Breeze else colorGroup = QPalette::Disabled; // render alternate background - if( viewItemOption && ( viewItemOption->features & QStyleOptionViewItemV2::Alternate ) ) + if( hasAlternateBackground ) { painter->setPen( Qt::NoPen ); painter->setBrush( palette.brush( colorGroup, QPalette::AlternateBase ) ); diff --git a/kstyle/breezewindowmanager.cpp b/kstyle/breezewindowmanager.cpp index debbe916..55fe2a16 100644 --- a/kstyle/breezewindowmanager.cpp +++ b/kstyle/breezewindowmanager.cpp @@ -758,7 +758,11 @@ namespace Breeze // gather options to retrieve checkbox subcontrol rect QStyleOptionGroupBox opt; opt.initFrom( groupBox ); + #if BREEZE_USE_KDE4 if( groupBox->isFlat() ) opt.features |= QStyleOptionFrameV2::Flat; + #else + if( groupBox->isFlat() ) opt.features |= QStyleOptionFrame::Flat; + #endif opt.lineWidth = 1; opt.midLineWidth = 0; opt.text = groupBox->title();