summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-10-15 17:06:34 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-22 19:36:43 +0200
commitb213d5bfa3a8ed81077cd8eaf229764ff2f1b346 (patch)
treec38b11225116886274631306e6018ffd23cdc2af /src/gui/painting/qpainter_p.h
parent11566de014ed22051a53f1f0c94697fd18a87500 (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/gui/painting/qpainter_p.h')
-rw-r--r--src/gui/painting/qpainter_p.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 6ad1cb07cc..0e46cee4b5 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -241,10 +241,6 @@ public:
void updateMatrix();
void updateInvMatrix();
- int rectSubtraction() const {
- return state->pen.style() != Qt::NoPen && state->pen.width() == 0 ? 1 : 0;
- }
-
void checkEmulation();
static QPainterPrivate *get(QPainter *painter)
@@ -269,6 +265,11 @@ Q_GUI_EXPORT void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, Q
QString qt_generate_brush_key(const QBrush &brush);
+inline bool qt_pen_is_cosmetic(const QPen &pen, QPainter::RenderHints hints)
+{
+ return pen.isCosmetic() || (const_cast<QPen &>(pen).data_ptr()->defaultWidth && (hints & QPainter::Qt4CompatiblePainting));
+}
+
QT_END_NAMESPACE
#endif // QPAINTER_P_H