|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QWindowSurface Class Reference
[QtGui module]

The QWindowSurface class provides the drawing area for top-level windows. More...

     #include <QWindowSurface>

This class is under development and is subject to change.

Inherited by QWSWindowSurface.

This class was introduced in Qt 4.3.

- List of all members, including inherited members

### Public Functions

- QWindowSurface ( QWidget * window )
- virtual ~QWindowSurface ()
- virtual void beginPaint ( const QRegion & region )
- virtual QImage * buffer ( const QWidget * widget )
- virtual void endPaint ( const QRegion & region )
- virtual void flush ( QWidget * widget, const QRegion & region, const QPoint & offset ) = 0
- QRect geometry () const
- virtual QPoint offset ( const QWidget * widget ) const
- virtual QPaintDevice * paintDevice () = 0
- QRect rect ( const QWidget * widget ) const
- virtual bool scroll ( const QRegion & area, int dx, int dy )
- virtual void setGeometry ( const QRect & rect )
- QWidget * window () const

## Detailed Description

The QWindowSurface class provides the drawing area for top-level windows.

## Member Function Documentation

### QWindowSurface::QWindowSurface ( QWidget * window )

Constructs an empty surface for the given top-level window.

### QWindowSurface::~QWindowSurface () `[virtual]`

Destroys this surface.

### void QWindowSurface::beginPaint ( const QRegion & region ) `[virtual]`

This function is called before painting onto the surface begins, with the region in which the painting will occur.

See also endPaint().

### QImage * QWindowSurface::buffer ( const QWidget * widget ) `[virtual]`

Returns a QImage pointer which represents the actual buffer the widget is drawn into or 0 if this is unavailable.

You must call beginPaint() before you call this function and the returned pointer is only valid until endPaint() is called.

### void QWindowSurface::endPaint ( const QRegion & region ) `[virtual]`

This function is called after painting onto the surface has ended, with the region in which the painting was performed.

See also beginPaint().

### void QWindowSurface::flush ( QWidget * widget, const QRegion & region, const QPoint & offset ) `[pure virtual]`

Flushes the given region from the specified widget onto the screen.

Note that the offset parameter is currently unused.

See also painterOffset().

### QRect QWindowSurface::geometry () const

Returns the currently allocated area on the screen.

See also setGeometry().

### QPoint QWindowSurface::offset ( const QWidget * widget ) const `[virtual]`

### QPaintDevice * QWindowSurface::paintDevice () `[pure virtual]`

Implement this function to return the appropriate paint device.

See also painterOffset().

### QRect QWindowSurface::rect ( const QWidget * widget ) const

### bool QWindowSurface::scroll ( const QRegion & area, int dx, int dy ) `[virtual]`

Scrolls the given region dx pixels to the right and dy downward; both dx and dy may be negative.

Returns true if the area was scrolled successfully; false otherwise.

### void QWindowSurface::setGeometry ( const QRect & rect ) `[virtual]`

Sets the currently allocated area to be the given rectangle.

This function is called whenever area covered by the top-level window changes.

See also geometry().

### QWidget * QWindowSurface::window () const

Returns a pointer to the top-level window associated with this surface.

See also isValid() and key().