# QwScrollingSpriteFieldView Class Reference

A QWidget which views a QwSpriteField, and has scrollbars. More...

`#include <QwSpriteField.h>`

Inherits QWidget and QwAbsSpriteFieldView.

List of all member functions.

## Public Members

- QwScrollingSpriteFieldView ( QwSpriteField * viewing=0, QWidget * parent=0, const char * name=0, WFlags f=0 )
- ~QwScrollingSpriteFieldView ()
- virtual QRect viewArea () const
- virtual bool preferDoubleBuffering () const
- virtual void beginPainter ( QPainter & )
- virtual void flush ( const QRect & area )
- virtual void updateGeometries ()

## Protected Members

- virtual void paintEvent ( QPaintEvent * )
- virtual void resizeEvent ( QResizeEvent * )
- virtual int hSteps () const
- virtual int vSteps () const

## Protected Slots

- void vScroll ( int )
- void hScroll ( int )

## Detailed Description

A QWidget which views a QwSpriteField, and has scrollbars.

While QwSpriteFieldView inside a QwViewport can be used for viewing a QwSpriteField, this may cause poor redraw effects if a lot of activity is occurring in the QwSpriteField, because scrolling by this method is a two part process: copy some area, then redraw the new area.

QwScrollingSpriteFieldView avoids this problem by doing these in a single operation. The downside is that it uses an off-screen pixmap for the whole visible area of the view and so is not practical if very large areas, or large numbers of areas, are required.

## Member Function Documentation

### QwScrollingSpriteFieldView::QwScrollingSpriteFieldView ( QwSpriteField * v=0, QWidget * parent=0, const char * name=0, WFlags f=0 )

Construct a QwSpriteFieldView which views the given QwSpriteField. The usual QWidget parameters may also be passed.

### QwScrollingSpriteFieldView::~QwScrollingSpriteFieldView ()

Deconstruct the QwScrollingSpriteFieldView.

### void QwScrollingSpriteFieldView::beginPainter ( QPainter & painter ) `[virtual]`

Configure the QPainter - makes it draw on this widget's offscreen pixmap, translated according to the scrollbars.

### void QwScrollingSpriteFieldView::flush ( const QRect & area ) `[virtual]`

Flush the off-screen changes.

### void QwScrollingSpriteFieldView::hScroll ( int v ) `[protected slot]`

Scrolls the view horizontally by the given amount.

### int QwScrollingSpriteFieldView::hSteps () const `[virtual protected]`

The stepping rate for the horizontal scrollbar. Returns 16.

### void QwScrollingSpriteFieldView::paintEvent ( QPaintEvent * ev ) `[virtual protected]`

(override)

Repaint the appropriate area of the QwScrollingSpriteFieldView which this QwScrollingSpriteFieldView is viewing.

### bool QwScrollingSpriteFieldView::preferDoubleBuffering () const `[virtual]`

Returns FALSE: double-buffering is not needed, since this class has its own offscreen pixmap.

### void QwScrollingSpriteFieldView::resizeEvent ( QResizeEvent * ) `[virtual protected]`

(override)

Deal with scrollbars.

### void QwScrollingSpriteFieldView::updateGeometries () `[virtual]`

Ensures scrollbars and off-screen pixmap are of the correct size given then current widget and field sizes. The field calls this automatically as needed.

### void QwScrollingSpriteFieldView::vScroll ( int v ) `[protected slot]`

Scrolls the view vertically by the given amount.

### int QwScrollingSpriteFieldView::vSteps () const `[virtual protected]`

The stepping rate for the vertical scrollbar. Returns 16.

### QRect QwScrollingSpriteFieldView::viewArea () const `[virtual]`

Returns the area of the viewport.

This file is copyright © 1995-97 Warwick Allison.

It was generated from the following files:

- QwSpriteField.h
- QwSpriteField-double.cpp
- QwSpriteField-int.cpp
- QwSpriteField-mobdouble.cpp
- QwSpriteField-mobint.cpp
- QwSpriteField-template.cpp
- QwSpriteField.cpp