From 71f7c1d006d0942fb91e795855bd00a35f226385 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 28 Dec 2009 13:58:25 +0100 Subject: QStyleSheetStyle: Fixed some text croped when having padding with native border. The native border width need to be taken into account in QRenderRule::boxRect() Task-number: QTBUG-6855 Reviewed-by: Benjamin Poulain (cherry picked from commit 6e90192b599cee9b903177a0978198326f667613) --- src/gui/styles/qstylesheetstyle.cpp | 2 +- tests/auto/uiloader/baseline/css_qtbug6855.ui | 57 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 tests/auto/uiloader/baseline/css_qtbug6855.ui diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index ca6968b..56cc364 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1065,7 +1065,7 @@ QRect QRenderRule::boxRect(const QRect& cr, int flags) const r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]); } } - if (!hasNativeBorder() && (flags & Border)) { + if (hasBorder() && (flags & Border)) { const int *b = border()->borders; r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]); } diff --git a/tests/auto/uiloader/baseline/css_qtbug6855.ui b/tests/auto/uiloader/baseline/css_qtbug6855.ui new file mode 100644 index 0000000..0727f6b --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtbug6855.ui @@ -0,0 +1,57 @@ + + + Form + + + + 0 + 0 + 212 + 108 + + + + Form + + + QPushButton { padding: 20px; } + + + + + + Text not cropped + + + + + + + Qt::Horizontal + + + + 258 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 218 + + + + + + + + + -- cgit v0.12