summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-05-11 13:37:12 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2019-07-03 06:53:34 +0200
commit1e4e006c3f6e8cbd0092fe882bc23a2280352a91 (patch)
tree903f38f0c0017712a1ede1446fa5fc664880049a /src
parente5ab131c18d1c2f75c097272c3300bf25f256367 (diff)
QPainter: mark obsolete RenderHints as deprecated
RenderHint::HighQualityAntialiasing and NonCosmeticDefaultPen are obsolete since Qt5 but not marked as such. Therefore add Q_DECL_ENUMERATOR_DEPRECATED_X now so those two enumerations can be removed with Qt6. [ChangeLog][QtGui][QPainter] HighQualityAntialiasing and NonCosmeticDefaultPen are marked as deprecated and don't have an effect anymore Change-Id: Ib0c966a078a1d23d492d0255288e2066c50e87b6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp5
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp6
-rw-r--r--src/gui/painting/qpainter.h6
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp5
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp6
5 files changed, 22 insertions, 6 deletions
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index 042b9ebd79..c087326068 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1475,7 +1475,10 @@ void QOpenGL2PaintEngineEx::renderHintsChanged()
if (!QOpenGLContext::currentContext()->isOpenGLES()) {
Q_D(QOpenGL2PaintEngineEx);
if ((state()->renderHints & QPainter::Antialiasing)
- || (state()->renderHints & QPainter::HighQualityAntialiasing))
+#if QT_DEPRECATED_SINCE(5, 14)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing)
+#endif
+ )
d->funcs.glEnable(GL_MULTISAMPLE);
else
d->funcs.glDisable(GL_MULTISAMPLE);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 64183c2be6..461ad51200 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -904,7 +904,11 @@ void QRasterPaintEngine::renderHintsChanged()
bool was_aa = s->flags.antialiased;
bool was_bilinear = s->flags.bilinear;
- s->flags.antialiased = bool(s->renderHints & (QPainter::Antialiasing | QPainter::HighQualityAntialiasing));
+ s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing);
+#if QT_DEPRECATED_SINCE(5, 14)
+ if (s->renderHints & QPainter::HighQualityAntialiasing)
+ s->flags.antialiased = true;
+#endif
s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform);
s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting);
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 843f24e3e1..3394da63c7 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -89,8 +89,10 @@ public:
Antialiasing = 0x01,
TextAntialiasing = 0x02,
SmoothPixmapTransform = 0x04,
- HighQualityAntialiasing = 0x08,
- NonCosmeticDefaultPen = 0x10,
+#if QT_DEPRECATED_SINCE(5, 14)
+ HighQualityAntialiasing Q_DECL_ENUMERATOR_DEPRECATED_X("Use Antialiasing instead") = 0x08,
+ NonCosmeticDefaultPen Q_DECL_ENUMERATOR_DEPRECATED_X("Default pen is non-cosmetic now") = 0x10,
+#endif
Qt4CompatiblePainting = 0x20,
LosslessImageRendering = 0x40,
};
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index cc97bed3f7..e8ff40304e 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1393,7 +1393,10 @@ void QGL2PaintEngineEx::renderHintsChanged()
#if !defined(QT_OPENGL_ES_2)
if (!d->ctx->contextHandle()->isOpenGLES()) {
if ((state()->renderHints & QPainter::Antialiasing)
- || (state()->renderHints & QPainter::HighQualityAntialiasing))
+#if QT_DEPRECATED_SINCE(5, 14)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing)
+#endif
+ )
d->glEnable(GL_MULTISAMPLE);
else
d->glDisable(GL_MULTISAMPLE);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index cf3e88d54e..d7aba66b2f 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -943,7 +943,11 @@ public:
// Default path (no optimization)
if (!(path.shape() == QVectorPath::LinesHint || path.shape() == QVectorPath::PolygonHint)
- || !pen.dashBrush || q->state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)) {
+ || !pen.dashBrush
+#if QT_DEPRECATED_SINCE(5, 14)
+ || q->state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)
+#endif
+ || q->state()->renderHints.testFlag(QPainter::Antialiasing)) {
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path);
if (!geometry) {
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);