QCommonStyle: remove references to QStyleOptionFrameV<n>
They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: I55539305df28267d0671a54a5cb7fcc17d045b8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
d488153fc2
commit
42d4e054a6
@ -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<const QStyleOptionFrame *>(opt)) {
|
||||
const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(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<const QStyleOptionFrameV3 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(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<const QStyleOptionFrameV2 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(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<const QStyleOptionFrameV3 *>(opt)) {
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user