|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.gui.QPaintEngine
public abstract class 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 and CoreGraphics
on Mac OS X. In addition we provide QPaintEngine implementations for OpenGL
(accessible through QGLWidget
) and PostScript
(accessible through QPSPrinter on X11). Additionally there is a raster-based paint engine that is a fallback for when an engine does not support a certain capability.
If one wants to use QPainter
to draw to a different backend, 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 Qt 3's QPainter
/QPaintDevice::cmd() approach is that it is now possible to adapt to multiple technologies on each platform and take advantage of each to the fullest.
QPainter
, QPaintDevice::paintEngine()
, and The Paint System.
Nested Class Summary | |
---|---|
static class |
QPaintEngine.DirtyFlag
These types are used by QPainter to trigger lazy updates of the various states in the QPaintEngine using QPaintEngine::updateState() . |
static class |
QPaintEngine.DirtyFlags
|
static class |
QPaintEngine.PaintEngineFeature
This enum is used to describe the features or capabilities that the paint engine has. |
static class |
QPaintEngine.PaintEngineFeatures
|
static class |
QPaintEngine.PolygonDrawMode
|
static class |
QPaintEngine.Type
|
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QPaintEngine()
Creates a paint engine with the featureset specified by caps. |
|
QPaintEngine(QPaintEngine.PaintEngineFeature[] features)
|
|
QPaintEngine(QPaintEngine.PaintEngineFeatures features)
Creates a paint engine with the featureset specified by caps. |
Method Summary | |
---|---|
protected int |
active()
Returns the active state of this paint engine. |
abstract boolean |
begin(QPaintDeviceInterface pdev)
Reimplement this function to initialise your paint engine when painting is to start on the paint device pdev. |
void |
clearDirty(QPaintEngine.DirtyFlag[] df)
|
void |
drawEllipse(QRect r)
The default implementation of this function calls the floating point version of this function |
void |
drawEllipse(QRectF r)
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect. |
void |
drawImage(QRectF r,
QImage pm,
QRectF sr)
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. |
void |
drawImage(QRectF r,
QImage pm,
QRectF sr,
Qt.ImageConversionFlag[] flags)
|
void |
drawImage(QRectF r,
QImage pm,
QRectF sr,
Qt.ImageConversionFlags flags)
Reimplement this function to draw the part of the image specified by the sr rectangle in the given rectangle using the given conversion flags flags, to convert it to a pixmap. |
void |
drawLines(QLine[] lines)
This is an overloaded member function, provided for convenience. |
void |
drawLines(QLineF[] lines)
The default implementation splits the list of lines in lines into lineCount separate calls to drawPath() or drawPolygon() depending on the feature set of the paint engine. |
void |
drawPath(QPainterPath path)
The default implementation ignores the path and does nothing. |
abstract void |
drawPixmap(QRectF r,
QPixmap pm,
QRectF sr)
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r. |
void |
drawPoints(QPoint[] points)
Draws the first pointCount points in the buffer points |
void |
drawPoints(QPointF[] points)
Draws the first pointCount points in the buffer points |
void |
drawPolygon(QPoint[] points,
QPaintEngine.PolygonDrawMode mode)
|
void |
drawPolygon(QPointF[] points,
QPaintEngine.PolygonDrawMode mode)
This is an overloaded member function, provided for convenience. |
void |
drawRects(QRect[] rects)
This is an overloaded member function, provided for convenience. |
void |
drawRects(QRectF[] rects)
Draws the first rectCount rectangles in the buffer rects. |
void |
drawTextItem(QPointF p,
QTextItem textItem)
This function draws the text item textItem at position p. |
void |
drawTiledPixmap(QRectF r,
QPixmap pixmap,
QPointF s)
Reimplement this function to draw the pixmap in the given rect, starting at the given p. |
abstract boolean |
end()
Reimplement this function to finish painting on the current paint device. |
protected int |
extended()
|
protected QPaintEngine.PaintEngineFeatures |
gccaps()
|
boolean |
hasFeature(QPaintEngine.PaintEngineFeature[] feature)
|
boolean |
hasFeature(QPaintEngine.PaintEngineFeatures feature)
Returns true if the paint engine supports the specified feature; otherwise returns false. |
boolean |
isActive()
Returns true if the paint engine is actively drawing; otherwise returns false. |
QPaintDeviceInterface |
paintDevice()
Returns the device that this engine is painting on, if painting is active; otherwise returns 0. |
QPainter |
painter()
Returns the paint engine's painter. |
protected int |
selfDestruct()
|
void |
setActive(boolean newState)
Sets the active state of the paint engine to state. |
protected void |
setActive(int active)
Sets the active state of the paint engine to active. |
void |
setDirty(QPaintEngine.DirtyFlag[] df)
|
protected void |
setExtended(int extended)
|
protected void |
setGccaps(QPaintEngine.PaintEngineFeature[] gccaps)
|
protected void |
setGccaps(QPaintEngine.PaintEngineFeatures gccaps)
|
protected void |
setSelfDestruct(int selfDestruct)
|
boolean |
testDirty(QPaintEngine.DirtyFlag[] df)
|
abstract QPaintEngine.Type |
type()
Reimplement this function to return the paint engine Type . |
abstract void |
updateState(QPaintEngineState state)
Reimplement this function to update the state of a paint engine. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QPaintEngine(QPaintEngine.PaintEngineFeature[] features)
public QPaintEngine()
public QPaintEngine(QPaintEngine.PaintEngineFeatures features)
Method Detail |
---|
public final void clearDirty(QPaintEngine.DirtyFlag[] df)
public final boolean hasFeature(QPaintEngine.PaintEngineFeature[] feature)
public final boolean hasFeature(QPaintEngine.PaintEngineFeatures feature)
public final boolean isActive()
setActive()
.
public final QPaintDeviceInterface paintDevice()
public final QPainter painter()
public final void setActive(boolean newState)
isActive()
.
public final void setDirty(QPaintEngine.DirtyFlag[] df)
public final boolean testDirty(QPaintEngine.DirtyFlag[] df)
public abstract boolean begin(QPaintDeviceInterface pdev)
end()
, and isActive()
.
public void drawEllipse(QRect r)
public void drawEllipse(QRectF r)
The default implementation calls drawPolygon()
.
public final void drawImage(QRectF r, QImage pm, QRectF sr, Qt.ImageConversionFlag[] flags)
public final void drawImage(QRectF r, QImage pm, QRectF sr)
public void drawImage(QRectF r, QImage pm, QRectF sr, Qt.ImageConversionFlags flags)
public void drawLines(QLine[] lines)
The default implementation converts the first lineCount lines in lines to a QLineF
and calls the floating point version of this function.
public void drawLines(QLineF[] lines)
drawPath()
or drawPolygon()
depending on the feature set of the paint engine.
public void drawPath(QPainterPath path)
public abstract void drawPixmap(QRectF r, QPixmap pm, QRectF sr)
public void drawPoints(QPoint[] points)
The default implementation converts the first pointCount QPoints in points to QPointFs and calls the floating point version of drawPoints.
public void drawPoints(QPointF[] points)
public void drawPolygon(QPoint[] points, QPaintEngine.PolygonDrawMode mode)
public void drawPolygon(QPointF[] points, QPaintEngine.PolygonDrawMode mode)
Reimplement this virtual function to draw the polygon defined by the pointCount first points in points, using mode mode.
Note: At least one of the drawPolygon()
functions must be reimplemented.
public void drawRects(QRect[] rects)
The default implementation converts the first rectCount rectangles in the buffer rects to a QRectF
and calls the floating point version of this function.
public void drawRects(QRectF[] rects)
drawPath()
or drawPolygon()
depending on the feature set of the paint engine.
public void drawTextItem(QPointF p, QTextItem textItem)
QPainterPath
and paints the resulting path.
public void drawTiledPixmap(QRectF r, QPixmap pixmap, QPointF s)
public abstract boolean end()
begin()
, and isActive()
.
public abstract QPaintEngine.Type type()
Type
.
public abstract void updateState(QPaintEngineState state)
When implemented, this function is responsible for checking the paint engine's current state and update the properties that are changed. Use the QPaintEngineState::state()
function to find out which properties that must be updated, then use the corresponding get function
to retrieve the current values for the given properties.
QPaintEngineState
.
protected final void setExtended(int extended)
protected final int extended()
protected final void setSelfDestruct(int selfDestruct)
protected final int selfDestruct()
protected final void setActive(int active)
protected final int active()
protected final void setGccaps(QPaintEngine.PaintEngineFeature[] gccaps)
protected final void setGccaps(QPaintEngine.PaintEngineFeatures gccaps)
protected final QPaintEngine.PaintEngineFeatures gccaps()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |