QCanvasView(3qt)

NAME
QCanvasView - A

#include <qcanvas.h>

Inherits QScrollView.

  Public Members
QCanvasView ( QCanvas * viewing=0, QWidget * parent=0, const char * name=0, WFlags f=0 )
~QCanvasView ()
QCanvas* canvas () const
void setCanvas ( QCanvas * v )

  Protected Members
virtual void drawContents ( QPainter *, int cx, int cy, int cw, int ch )
virtual QSize sizeHint () const

DESCRIPTION
A QWidget which views a QCanvas.

Displays a view of a QCanvas, with scrollbars available if desired. There can be more than one view of a canvas.

The view of a canvas is the object which the user can see and interact with, hence any interactivity will be based on events from a view. For example, by subclassing QCanvasView and overriding QScrollView::contentsMousePressEvent(), an application can provide a canvas where the user can interact with items on the canvas.

  void MyCanvasView::contentsMousePressEvent(QMouseEvent* e)
  {
      QCanvasItemList list = canvas()->collisions(e->pos());
      if ( !list.isEmpty() ) {
          QCanvasItem* item = list.first();
          // Process the top item
          ...
      }
  }

Most of the functionality of QCanvasView is the functionality available for all QScrollView subclasses.

MEMBER FUNCTION DOCUMENTATION

QCanvasView::QCanvasView ( QCanvas * canvas=0, QWidget * parent=0, const char * name=0, WFlags f=0 )
Constructs a QCanvasView which views canvas. The usual QWidget parameters may also be supplied.

QCanvasView::~QCanvasView ()
Destructs the view. The associated canvas is not deleted.

QCanvas* QCanvasView::canvas () const
Returns the canvas which the view is currently viewing.

void QCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch ) [virtual protected]
Repaints the appropriate area of the QCanvas which this QCanvasView is viewing.

Reimplemented from QScrollView.

void QCanvasView::setCanvas ( QCanvas * canvas )
Changes the QCanvas which the QCanvasView is viewing to canvas.

QSize QCanvasView::sizeHint () const [virtual protected]
Suggests a size sufficient to view the entire canvas.

Reimplemented from QWidget.

SEE ALSO
http://doc.trolltech.com/qcanvasview.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports make our job much simpler. Thank you.

In case of content or formattting problems with this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qcanvasview.3) and the Qt version (2.3.2).