Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform. More...
#include <QPaintEngine>
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a given platform.
Qt 4.0 provides several premade implementations of QPaintEngine for the different painter backends we support. We provide one paint engine for each window system and painting framework we support. This includes X11 on Unix/Linux, GDI/GDI+ on Windows and QuickDraw/CoreGraphics on Mac OS X. In addition we provide QPaintEngine implementations for OpenGL (accessible through QGLWidget) and PostScript (accessible through QPSPrinter on X11).
If one wants to use QPainter to draw to a different backend, such as PDF, one must subclass QPaintEngine and reimplement all its virtual functions. The QPaintEngine implementation is then made available by subclassing QPaintDevice and reimplementing the virtual function QPaintDevice::paintEngine().
QPaintEngine is created and owned by the QPaintDevice that created it.
The big advantage of the QPaintEngine approach opposed to the previous QPainter/QPaintDevice::cmd() approach is that it is now possible to adapt to multiple technologies on each platform and take advantage of the to the fullest.
See also QPainter and QPaintDevice::paintEngine().
This enum is used to describe the features or capabilities that the paint engine has. If a feature is not supported by the engine, QPainter will do a best effort to emulate that feature through other means. The features that are currently emulated are: CoordTransform, PixmapTransform, LinearGradients, PixmapScale, AlphaFill and ClipTransform.
QPaintEngine::CoordTransform | The engine can transform the points in a drawing operation. |
QPaintEngine::PenWidthTransform | The engine has support for transforming pen widths. |
QPaintEngine::PatternTransform | The engine has support for transforming brush patterns. |
QPaintEngine::PixmapTransform | The engine can transform pixmaps, including rotation and shearing. |
QPaintEngine::LinearGradients | The engine can fill with linear gradients |
QPaintEngine::PixmapScale | The engine can scale pixmaps. |
QPaintEngine::AlphaFill | The engine can fill and outline with alpha colors |
QPaintEngine::PainterPaths | The engine has path support. |
QPaintEngine::ClipTransform | The engine is capable of transforming clip regions. |
QPaintEngine::PaintOutsidePaintEvent | The engine is capable of painting outside of paint events. |
The PaintEngineFeatures typedef can store a combination of PaintEngineFeature values.
QPaintEngine::OddEvenMode | |
QPaintEngine::WindingMode | |
QPaintEngine::ConvexMode | |
QPaintEngine::PolylineMode |
QPaintEngine::X11 | |
QPaintEngine::Windows | |
QPaintEngine::Gdiplus | (same as Windows) |
QPaintEngine::QuickDraw | (same as CoreGraphics) |
QPaintEngine::MacPrinter | |
QPaintEngine::CoreGraphics | Mac OS X |
QPaintEngine::QWindowSystem | Qt/Embedded |
QPaintEngine::PostScript | |
QPaintEngine::OpenGL | |
QPaintEngine::Picture | QPicture format |
QPaintEngine::SVG | Scalable Vector Graphics XML format |
QPaintEngine::User | First user type ID |
QPaintEngine::MaxUser | Last user type ID |
Creates a paint engine with the featureset specified by caps.
Destroys the paint engine.
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. Return true if the initialization was successful; otherwise return false.
See also end() and isActive().
Clears the render hints specified by hints.
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
The default implementation calls drawPolygon().
See also drawPolygon.
The default implementation splits line into two points and calls the integer version of drawLine().
Calls drawLine() for every pair of points in the point array pa.
The default implementation ignores the path and does nothing.
Reimplement this function to draw the part of the pixmap specified by the sr rectangle in the given rectangle using the given drawing mode.
The default implementation converts pf to an integer point and calls the integer version of drawPoint().
Calls drawPoint() to draw every point in the point array pa.
Reimplement this pure virtual function to draw polygon using the drawing mode mode.
The default implementation converts rf to an integer rectangle and calls the integer version of drawRect().
Draws the rectangles in the list rects.
This function draws the text item ti at position p in accordance with the given textFlags. The default implementation of this function renders the text to a pixmap and draws the resultant pixmap.
Reimplement this function to draw the pixmap in the given rectangle, starting at the given point. The pixmap will be drawn repeatedly until the rectangle is filled using the given mode.
Reimplement this function to finish painting on the current paint device. Return true if painting was finished successfully; otherwise return false.
See also begin() and isActive().
Returns true if the paint engine supports the specified feature; otherwise returns false.
Returns true if the paint engine is actively drawing; otherwise returns false.
See also setActive().
Returns the paint engine's painter.
Returns the currently set renderhints.
Sets the active state of the paint engine to state.
See also isActive().
Sets the the render hints specified by hints in addition to the currently set render hints.
See also clearRenderHints().
Returns the set of supported renderhints.
Reimplement this function to return the paint engine Type.
This function is called when the engine needs to be updated with new background settings. bgmode describes the background mode and brush describes the background brush.
This function is called when the engine needs to be updated with a new brush, specified with brush. origin describes the brush origin.
This function is called when the engine needs to be updated with the new clip path. The value of enabled signifies whether or not the clippath should be enabled.
This function is called when the clip region changes, specified by region or when clipping is enabled or disabled, specified by enabled.
This function is called when the engine needs to be updated with a new font, specified by f
This function is called when the engine needs to be updated with new transformation settings, specified with matrix.
This function is called when the engine needs to be updated with the a new pen, specified by pen.
This function is caleed when the engine needs to be updated with the new set of renderhints specified by hints.
Copyright © 2004 Trolltech. | Trademarks | Qt 4.0.0-tp2 |