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>
bb10
Alessandro Portale 2017-07-07 16:46:47 +02:00
parent 01af6771c3
commit c827afa282
1 changed files with 2 additions and 7 deletions

View File

@ -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)