From 52ccbd8911f1b96b8bea6a4c9da4d4a762dee2a7 Mon Sep 17 00:00:00 2001 From: aavit Date: Tue, 23 Oct 2012 15:27:18 +0200 Subject: Fix: don't override the new non-cosmetic default pen in qwidget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As QWidget initializes any painter created in paintevent handler to have the pen color of the palette's foreground, setting it to 0 width, i.e. cosmetic, it negated the effect of the recent change to default 1-width non-cosmetic, ref. I04d910e9700baf7f13a8aac07a3633014bb9283e This caused scaled painting with default pen on QImage and QWidget to yield different results. Change-Id: I930b64bf7c0a8c84b9ea3edb49adc813370fed0e Reviewed-by: Samuel Rødal --- tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 57b7d08ab0..80de2da975 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -2508,8 +2508,8 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { - dirtyPainter = (painter->pen().width() != 0); - painter->setPen(QPen(Qt::black, 1.0)); + dirtyPainter = (painter->pen().color() != Qt::black); + painter->setPen(Qt::red); } }; -- cgit v1.2.3