Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QPaintEngine

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.gui.QPaintEngine

All Implemented Interfaces:
  QtJambiInterface

    public abstract class QPaintEngine

extends QtJambiObject

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.

See Also:
  `QPainter`, `QPaintDevice::paintEngine`, 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` 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.AbstractSignal, 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

### QPaintEngine

    public QPaintEngine()

  Equivalent to `QPaintEngine`(0).

### QPaintEngine

    public QPaintEngine(QPaintEngine.PaintEngineFeatures features)

  Creates a paint engine with the featureset specified by `features`.

Method Detail

### clearDirty

    public final void clearDirty(QPaintEngine.DirtyFlag... df)

### clearDirty

    public final void clearDirty(QPaintEngine.DirtyFlags df)

### hasFeature

    public final boolean hasFeature(QPaintEngine.PaintEngineFeature... feature)

  Returns true if the paint engine supports the specified `feature`; otherwise returns false.

### hasFeature

    public final boolean hasFeature(QPaintEngine.PaintEngineFeatures feature)

  Returns true if the paint engine supports the specified `feature`; otherwise returns false.

### isActive

    public final boolean isActive()

  Returns true if the paint engine is actively drawing; otherwise returns false.

  See Also:
    `setActive`

### paintDevice

    public final QPaintDeviceInterface paintDevice()

  Returns the device that this engine is painting on, if painting is active; otherwise returns 0.

### painter

    public final QPainter painter()

  Returns the paint engine's painter.

### setActive

    public final void setActive(boolean newState)

  Sets the active state of the paint engine to `newState`.

  See Also:
    `active`, `isActive`

### setDirty

    public final void setDirty(QPaintEngine.DirtyFlag... df)

### setDirty

    public final void setDirty(QPaintEngine.DirtyFlags df)

### setSystemClip

    public final void setSystemClip(QRegion baseClip)

  See Also:
    `systemClip`

### setSystemRect

    public final void setSystemRect(QRect rect)

  See Also:
    `systemRect`

### syncState

    public final void syncState()

### systemClip

    public final QRegion systemClip()

  See Also:
    `setSystemClip`

### systemRect

    public final QRect systemRect()

  See Also:
    `setSystemRect`

### testDirty

    public final boolean testDirty(QPaintEngine.DirtyFlag... df)

### testDirty

    public final boolean testDirty(QPaintEngine.DirtyFlags df)

### begin

    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.

  See Also:
    `end`, `isActive`

### coordinateOffset

    public QPoint coordinateOffset()

### drawEllipse

    public void drawEllipse(QRect r)

  The default implementation of this function calls the floating point version of this function

### drawEllipse

    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`.

### drawImage

    public final 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.

### drawImage

    public final void drawImage(QRectF r,
                                QImage pm,
                                QRectF sr)

  Equivalent to `drawImage`(`r`, `pm`, `sr`, Qt::AutoColor).

### drawImage

    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.

### drawLines

    public void drawLines(QLineF[] lines)

  Equivalent to `drawLines`(`lines`, ).

### drawLines

    public void drawLines(QLine[] lines)

  Equivalent to `drawLines`(`lines`, ).

### drawPath

    public void drawPath(QPainterPath path)

  The default implementation ignores the `path` and does nothing.

### drawPixmap

    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`.

### drawPoints

    public void drawPoints(QPointF[] points)

  Equivalent to `drawPoints`(`points`, ).

### drawPoints

    public void drawPoints(QPoint[] points)

  Equivalent to `drawPoints`(`points`, ).

### drawPolygon

    public void drawPolygon(QPointF[] points,
                            QPaintEngine.PolygonDrawMode mode)

  Equivalent to `drawPolygon`(`points`, `mode`, ).

### drawPolygon

    public void drawPolygon(QPoint[] points,
                            QPaintEngine.PolygonDrawMode mode)

  Equivalent to `drawPolygon`(`points`, `mode`, ).

### drawRects

    public void drawRects(QRect[] rects)

  Equivalent to `drawRects`(`rects`, ).

### drawRects

    public void drawRects(QRectF[] rects)

  Equivalent to `drawRects`(`rects`, ).

### drawTextItem

    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.

### drawTiledPixmap

    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.

### end

    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.

  See Also:
    `begin`, `isActive`

### type

    public abstract QPaintEngine.Type type()

  Reimplement this function to return the paint engine Type.

### updateState

    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.

  See Also:
    `QPaintEngineState`

### setActive

    protected final void setActive(int active)

  Sets the active state of the paint engine to `active`.

### active

    protected final int active()

  Returns the active state of this paint engine.

### setGccaps

    protected final void setGccaps(QPaintEngine.PaintEngineFeature... gccaps)

  Sets this QPaintEngine's `gccaps`.

### fromNativePointer

    public static QPaintEngine fromNativePointer(QNativePointer nativePointer)

  This function returns the QPaintEngine instance pointed to by nativePointer

  Parameters:
    `nativePointer` - the QNativePointer of which object should be returned.

Overview | Package | Class | Tree | Deprecated | Index | Help
Qt Jambi Home |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD