diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2017-07-07 16:46:47 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2017-08-29 11:53:03 +0000 |
commit | c827afa2820e539179c5d11ca073e4d90e98df5d (patch) | |
tree | 49c788580332b9b8bdd0c1d28cb3bf7e8b27e858 /src/widgets | |
parent | 01af6771c3c2f575840da58abb8da2594f8144ae (diff) |
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 <michael.winkelmann@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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) |