From 42d4e054a6cebd83d7b086330d64d108916de3e3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 22 Sep 2014 20:31:53 +0200 Subject: [PATCH] QCommonStyle: remove references to QStyleOptionFrameV They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: I55539305df28267d0671a54a5cb7fcc17d045b8b Reviewed-by: Friedemann Kleint --- src/widgets/styles/qcommonstyle.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 08d87a3afd..bc455dd5c0 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -418,8 +418,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q #ifndef QT_NO_GROUPBOX case PE_FrameGroupBox: if (const QStyleOptionFrame *frame = qstyleoption_cast(opt)) { - const QStyleOptionFrameV2 *frame2 = qstyleoption_cast(opt); - if (frame2 && (frame2->features & QStyleOptionFrameV2::Flat)) { + if (frame->features & QStyleOptionFrame::Flat) { QRect fr = frame->rect; QPoint p1(fr.x(), fr.y() + 1); QPoint p2(fr.x() + fr.width(), p1.y()); @@ -2232,7 +2231,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, #endif // QT_NO_ITEMVIEWS #ifndef QT_NO_FRAME case CE_ShapedFrame: - if (const QStyleOptionFrameV3 *f = qstyleoption_cast(opt)) { + if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { int frameShape = f->frameShape; int frameShadow = QFrame::Plain; if (f->state & QStyle::State_Sunken) { @@ -2822,14 +2821,14 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; case SE_FrameContents: - if (const QStyleOptionFrameV2 *f = qstyleoption_cast(opt)) { + if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, f, widget); r = opt->rect.adjusted(fw, fw, -fw, -fw); r = visualRect(opt->direction, opt->rect, r); } break; case SE_ShapedFrameContents: - if (const QStyleOptionFrameV3 *f = qstyleoption_cast(opt)) { + if (const QStyleOptionFrame *f = qstyleoption_cast(opt)) { int frameShape = f->frameShape; int frameShadow = QFrame::Plain; if (f->state & QStyle::State_Sunken) { @@ -3650,7 +3649,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl QRect textRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxLabel, widget); QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, opt, SC_GroupBoxCheckBox, widget); if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { - QStyleOptionFrameV2 frame; + QStyleOptionFrame frame; frame.QStyleOption::operator=(*groupBox); frame.features = groupBox->features; frame.lineWidth = groupBox->lineWidth; @@ -4241,7 +4240,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex } int frameWidth = 0; - if ((groupBox->features & QStyleOptionFrameV2::Flat) == 0) + if ((groupBox->features & QStyleOptionFrame::Flat) == 0) frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); ret = frameRect.adjusted(frameWidth, frameWidth + topHeight - topMargin, -frameWidth, -frameWidth); @@ -4253,7 +4252,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex QFontMetrics fontMetrics = groupBox->fontMetrics; int h = fontMetrics.height(); int tw = fontMetrics.size(Qt::TextShowMnemonic, groupBox->text + QLatin1Char(' ')).width(); - int marg = (groupBox->features & QStyleOptionFrameV2::Flat) ? 0 : 8; + int marg = (groupBox->features & QStyleOptionFrame::Flat) ? 0 : 8; ret = groupBox->rect.adjusted(marg, 0, -marg, 0); ret.setHeight(h);