QCPainterFactory Class
QCPainterFactory manages instances of QCPainter and the associated rendering engine. More...
| Header: | #include <QCPainterFactory> |
Detailed Description
Applications rendering via QCPainter do not create instances of the painter class themselves, but rather are expected to use a QCPainterFactory. This is relevant only when working with QCPainter without a convenience class such as QCPainterWidget or QQuickCPainterItem, because those provide a QCPainter instance to the application.
All drawing code that operates on the same thread and is using the same QRhi underneath is recommended to share and reuse the same QCPainter, instead of having a dedicated painter (and so factory) in each component. This can be achieved by calling sharedInstance(), instead of constructing a new QCPainterFactory.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.