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/widgets/graphicsview/qgraphicsitem.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/widgets/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 375aa9b6ca..c432902fc2 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -8030,7 +8030,7 @@ QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem() /*! Returns the item's pen. If no pen has been set, this function returns - QPen(), a default black solid line pen with 0 width. + QPen(), a default black solid line pen with 1 width. */ QPen QAbstractGraphicsShapeItem::pen() const { @@ -8204,7 +8204,7 @@ QRectF QGraphicsPathItem::boundingRect() const { Q_D(const QGraphicsPathItem); if (d->boundingRect.isNull()) { - qreal pw = pen().widthF(); + qreal pw = pen().style() == Qt::NoPen ? qreal(0) : pen().widthF(); if (pw == 0.0) d->boundingRect = d->path.controlPointRect(); else { @@ -8434,7 +8434,7 @@ QRectF QGraphicsRectItem::boundingRect() const { Q_D(const QGraphicsRectItem); if (d->boundingRect.isNull()) { - qreal halfpw = pen().widthF() / 2; + qreal halfpw = pen().style() == Qt::NoPen ? qreal(0) : pen().widthF() / 2; d->boundingRect = d->rect; if (halfpw > 0.0) d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw); @@ -8723,7 +8723,7 @@ QRectF QGraphicsEllipseItem::boundingRect() const { Q_D(const QGraphicsEllipseItem); if (d->boundingRect.isNull()) { - qreal pw = pen().widthF(); + qreal pw = pen().style() == Qt::NoPen ? qreal(0) : pen().widthF(); if (pw == 0.0 && d->spanAngle == 360 * 16) d->boundingRect = d->rect; else @@ -8959,7 +8959,7 @@ QRectF QGraphicsPolygonItem::boundingRect() const { Q_D(const QGraphicsPolygonItem); if (d->boundingRect.isNull()) { - qreal pw = pen().widthF(); + qreal pw = pen().style() == Qt::NoPen ? qreal(0) : pen().widthF(); if (pw == 0.0) d->boundingRect = d->polygon.boundingRect(); else |