From 33254fb41f29b510d3d74dbaab60f0a67ef56d46 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 12 Dec 2023 14:54:50 +0100 Subject: Turn the "concentriccircles" example into snippets, update screenshot The example has a lot of code and documentation, but in essence shows how to use float-based QPainter APIs and how to set a render hint. That is two lines of code, which we can show as snippets. Update the screenshot of the example with a higher-resolution version. Pick-to: 6.7 6.6 Fixes: QTBUG-119983 Change-Id: Iafcb813dff6ab8c269176f7994c95947ebf5e559 Reviewed-by: Eirik Aavitsland --- src/gui/painting/qpainter.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 70bcd92fdd..756acdb583 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1125,24 +1125,22 @@ void QPainterPrivate::updateState(QPainterState *newState) The QPainter class also provides a means of controlling the rendering quality through its RenderHint enum and the support for floating point precision: All the functions for drawing primitives - has a floating point version. These are often used in combination + have floating point versions. + + \snippet code/src_gui_painting_qpainter.cpp floatBased + + These are often used in combination with the \l {RenderHint}{QPainter::Antialiasing} render hint. + \snippet code/src_gui_painting_qpainter.cpp renderHint + \table 100% \row + \li Comparing concentric circles with int and float, and with or without + anti-aliased rendering. Using the floating point precision versions + produces evenly spaced rings. Anti-aliased rendering results in + smooth circles. \li \inlineimage qpainter-concentriccircles.png - \li - \b {Concentric Circles Example} - - The \l {painting/concentriccircles}{Concentric Circles} example - shows the improved rendering quality that can be obtained using - floating point precision and anti-aliasing when drawing custom - widgets. - - The application's main window displays several widgets which are - drawn using the various combinations of precision and - anti-aliasing. - \endtable The RenderHint enum specifies flags to QPainter that may or may -- cgit v1.2.3