|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
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
This QFlag class provides flags for the int enum. |
static class |
QPaintEngine.PaintEngineFeature
This enum is used to describe the features or capabilities that the paint engine has. |
static class |
QPaintEngine.PaintEngineFeatures
This QFlag class provides flags for the int enum. |
static class |
QPaintEngine.PolygonDrawMode
Press link for info on QPaintEngine.PolygonDrawMode |
static class |
QPaintEngine.Type
Press link for info on QPaintEngine.Type |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QPaintEngine()
Equivalent to QPaintEngine(0). |
|
QPaintEngine(QPaintEngine.PaintEngineFeatures features)
Creates a paint engine with the featureset specified by features. |
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 |
clearDirty(QPaintEngine.DirtyFlags df)
|
QPoint |
coordinateOffset()
|
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 r. |
void |
drawImage(QRectF r,
QImage pm,
QRectF sr)
Equivalent to drawImage(r, pm, sr, Qt::AutoColor). |
void |
drawImage(QRectF r,
QImage pm,
QRectF sr,
Qt.ImageConversionFlag... flags)
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r using the given conversion flags flags, to convert it to a pixmap. |
void |
drawImage(QRectF r,
QImage pm,
QRectF sr,
Qt.ImageConversionFlags flags)
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r using the given conversion flags flags, to convert it to a pixmap. |
void |
drawLines(QLine[] lines)
Equivalent to drawLines(lines, ). |
void |
drawLines(QLineF[] lines)
Equivalent to drawLines(lines, ). |
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)
Equivalent to drawPoints(points, ). |
void |
drawPoints(QPointF[] points)
Equivalent to drawPoints(points, ). |
void |
drawPolygon(QPoint[] points,
QPaintEngine.PolygonDrawMode mode)
Equivalent to drawPolygon(points, mode, ). |
void |
drawPolygon(QPointF[] points,
QPaintEngine.PolygonDrawMode mode)
Equivalent to drawPolygon(points, mode, ). |
void |
drawRects(QRect[] rects)
Equivalent to drawRects(rects, ). |
void |
drawRects(QRectF[] rects)
Equivalent to drawRects(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 r, starting at the given s. |
abstract boolean |
end()
Reimplement this function to finish painting on the current paint device. |
static QPaintEngine |
fromNativePointer(QNativePointer nativePointer)
This function returns the QPaintEngine instance pointed to by nativePointer |
boolean |
hasFeature(QPaintEngine.PaintEngineFeature... feature)
Returns true if the paint engine supports the specified feature; otherwise returns false. |
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. |
void |
setActive(boolean newState)
Sets the active state of the paint engine to newState. |
protected void |
setActive(int active)
Sets the active state of the paint engine to active. |
void |
setDirty(QPaintEngine.DirtyFlag... df)
|
void |
setDirty(QPaintEngine.DirtyFlags df)
|
protected void |
setGccaps(QPaintEngine.PaintEngineFeature... gccaps)
Sets this QPaintEngine's gccaps. |
void |
setSystemClip(QRegion baseClip)
|
void |
setSystemRect(QRect rect)
|
void |
syncState()
|
QRegion |
systemClip()
|
QRect |
systemRect()
|
boolean |
testDirty(QPaintEngine.DirtyFlag... df)
|
boolean |
testDirty(QPaintEngine.DirtyFlags 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, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, 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()
Equivalent to QPaintEngine(0).
public QPaintEngine(QPaintEngine.PaintEngineFeatures features)
Creates a paint engine with the featureset specified by features.
Method Detail |
---|
public final void clearDirty(QPaintEngine.DirtyFlag... df)
public final void clearDirty(QPaintEngine.DirtyFlags df)
public final boolean hasFeature(QPaintEngine.PaintEngineFeature... feature)
Returns true if the paint engine supports the specified feature; otherwise returns false.
public final boolean hasFeature(QPaintEngine.PaintEngineFeatures feature)
Returns true if the paint engine supports the specified feature; otherwise returns false.
public final boolean isActive()
Returns true if the paint engine is actively drawing; otherwise returns false.
public final QPaintDeviceInterface paintDevice()
Returns the device that this engine is painting on, if painting is active; otherwise returns 0.
public final QPainter painter()
Returns the paint engine's painter.
public final void setActive(boolean newState)
Sets the active state of the paint engine to newState.
public final void setDirty(QPaintEngine.DirtyFlag... df)
public final void setDirty(QPaintEngine.DirtyFlags df)
public final void setSystemClip(QRegion baseClip)
public final void setSystemRect(QRect rect)
public final void syncState()
public final QRegion systemClip()
public final QRect systemRect()
public final boolean testDirty(QPaintEngine.DirtyFlag... df)
public final boolean testDirty(QPaintEngine.DirtyFlags df)
public abstract boolean begin(QPaintDeviceInterface pdev)
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.
public QPoint coordinateOffset()
public void drawEllipse(QRect r)
The default implementation of this function calls the floating point version of this function
public void drawEllipse(QRectF r)
Reimplement this function to draw the largest ellipse that can be contained within rectangle 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)
Equivalent to drawImage(r, pm, sr, Qt::AutoColor).
public void drawImage(QRectF r, QImage pm, QRectF sr, Qt.ImageConversionFlags flags)
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r using the given conversion flags flags, to convert it to a pixmap.
public void drawLines(QLineF[] lines)
Equivalent to drawLines(lines, ).
public void drawLines(QLine[] lines)
Equivalent to drawLines(lines, ).
public void drawPath(QPainterPath path)
The default implementation ignores the path and does nothing.
public 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.
public void drawPoints(QPointF[] points)
Equivalent to drawPoints(points, ).
public void drawPoints(QPoint[] points)
Equivalent to drawPoints(points, ).
public void drawPolygon(QPointF[] points, QPaintEngine.PolygonDrawMode mode)
Equivalent to drawPolygon(points, mode, ).
public void drawPolygon(QPoint[] points, QPaintEngine.PolygonDrawMode mode)
Equivalent to drawPolygon(points, mode, ).
public void drawRects(QRect[] rects)
Equivalent to drawRects(rects, ).
public void drawRects(QRectF[] rects)
Equivalent to drawRects(rects, ).
public void drawTextItem(QPointF p, QTextItem textItem)
This function draws the text item textItem at position p. The default implementation of this function converts the text to a QPainterPath and paints the resulting path.
public void drawTiledPixmap(QRectF r, QPixmap pixmap, QPointF s)
Reimplement this function to draw the pixmap in the given r, starting at the given s. The pixmap will be drawn repeatedly until the r is filled.
public abstract boolean end()
Reimplement this function to finish painting on the current paint device. Return true if painting was finished successfully; otherwise return false.
public abstract QPaintEngine.Type type()
Reimplement this function to return the paint engine Type.
public abstract void updateState(QPaintEngineState state)
Reimplement this function to update the state of a paint engine.
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.
protected final void setActive(int active)
protected final int active()
protected final void setGccaps(QPaintEngine.PaintEngineFeature... gccaps)
public static QPaintEngine fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |