diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-15 17:06:34 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-22 19:36:43 +0200 |
commit | b213d5bfa3a8ed81077cd8eaf229764ff2f1b346 (patch) | |
tree | c38b11225116886274631306e6018ffd23cdc2af /src/printsupport/kernel/qprintengine_win.cpp | |
parent | 11566de014ed22051a53f1f0c94697fd18a87500 (diff) |
Make QPen default to 1-width non-cosmetic.
Use the Qt4CompatiblePainting render hint when painting with QPainter to
treat default constructed QPens as cosmetic still.
The NonCosmeticDefaultPen render hint gets documented as obsolete, since
it was in any case not respected by the raster nor OpenGL paint engine.
Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/printsupport/kernel/qprintengine_win.cpp')
-rw-r--r-- | src/printsupport/kernel/qprintengine_win.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index 27351dee48..28e0363d6e 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -852,6 +852,8 @@ void QWin32PrintEnginePrivate::fillPath_dev(const QPainterPath &path, const QCol void QWin32PrintEnginePrivate::strokePath_dev(const QPainterPath &path, const QColor &color, qreal penWidth) { + Q_Q(QWin32PrintEngine); + composeGdiPath(path); LOGBRUSH brush; brush.lbStyle = BS_SOLID; @@ -868,7 +870,9 @@ void QWin32PrintEnginePrivate::strokePath_dev(const QPainterPath &path, const QC else if (pen.joinStyle() == Qt::RoundJoin) joinStyle = PS_JOIN_ROUND; - HPEN pen = ExtCreatePen(((penWidth == 0) ? PS_COSMETIC : PS_GEOMETRIC) + bool cosmetic = qt_pen_is_cosmetic(pen, q->state->renderHints()); + + HPEN pen = ExtCreatePen((cosmetic ? PS_COSMETIC : PS_GEOMETRIC) | PS_SOLID | capStyle | joinStyle, (penWidth == 0) ? 1 : penWidth, &brush, 0, 0); @@ -885,6 +889,8 @@ void QWin32PrintEnginePrivate::fillPath(const QPainterPath &path, const QColor & void QWin32PrintEnginePrivate::strokePath(const QPainterPath &path, const QColor &color) { + Q_Q(QWin32PrintEngine); + QPainterPathStroker stroker; if (pen.style() == Qt::CustomDashLine) { stroker.setDashPattern(pen.dashPattern()); @@ -898,11 +904,12 @@ void QWin32PrintEnginePrivate::strokePath(const QPainterPath &path, const QColor QPainterPath stroke; qreal width = pen.widthF(); - if (pen.style() == Qt::SolidLine && (pen.isCosmetic() || matrix.type() < QTransform::TxScale)) { + bool cosmetic = qt_pen_is_cosmetic(pen, q->state->renderHints()); + if (pen.style() == Qt::SolidLine && (cosmetic || matrix.type() < QTransform::TxScale)) { strokePath_dev(path * matrix, color, width); } else { stroker.setWidth(width); - if (pen.isCosmetic()) { + if (cosmetic) { stroke = stroker.createStroke(path * matrix); } else { stroke = stroker.createStroke(path) * painterMatrix; |