From c827afa2820e539179c5d11ca073e4d90e98df5d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 7 Jul 2017 16:46:47 +0200 Subject: QWidgets/CommonStyle: Fix tooltip drawing under HighDPI Delegating the border painting to qDrawPlainRect ensures that there are no off-by-one pixel issues. Task-number: QTBUG-61849 Change-Id: I56dc849da80fad00d02a0f9c60dbb621e6de7c48 Reviewed-by: Michael Winkelmann Reviewed-by: J-P Nurmi Reviewed-by: Alessandro Portale --- src/widgets/styles/qcommonstyle.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 64a3a73b0d..a8f8c97776 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -572,13 +572,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q break; } #endif // QT_NO_SPINBOX case PE_PanelTipLabel: { - QBrush oldBrush = p->brush(); - QPen oldPen = p->pen(); - p->setPen(QPen(opt->palette.toolTipText(), 0)); - p->setBrush(opt->palette.toolTipBase()); - p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); - p->setPen(oldPen); - p->setBrush(oldBrush); + const QBrush brush(opt->palette.toolTipBase()); + qDrawPlainRect(p, opt->rect, opt->palette.toolTipText().color(), 1, &brush); break; } #if QT_CONFIG(tabbar) -- cgit v1.2.3