From 55cf7c577da015bd6d48a034902477b83cf73be7 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 27 Feb 2013 17:21:11 +0100 Subject: [PATCH] Fix QCommonStyle::drawControl(CE_ShapedFrame) for QFrame::H/VLine Respect QStyleOption::rect, do not expect Y to be 0. Task-number: QTBUG-29926 Change-Id: I6304d20f629f89774c897d2c81c2c7816dff4718 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index d1d80f5af0..4b6ba17595 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -2265,11 +2265,11 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, case QFrame::VLine: { QPoint p1, p2; if (frameShape == QFrame::HLine) { - p1 = QPoint(opt->rect.x(), opt->rect.height() / 2); + p1 = QPoint(opt->rect.x(), opt->rect.y() + opt->rect.height() / 2); p2 = QPoint(opt->rect.x() + opt->rect.width(), p1.y()); } else { - p1 = QPoint(opt->rect.x()+opt->rect.width() / 2, 0); - p2 = QPoint(p1.x(), opt->rect.height()); + p1 = QPoint(opt->rect.x() + opt->rect.width() / 2, opt->rect.y()); + p2 = QPoint(p1.x(), p1.y() + opt->rect.height()); } if (frameShadow == QFrame::Plain) { QPen oldPen = p->pen();