A QWidget which views a QCanvas. More...
#include <qcanvas.h>
Inherits QScrollView.
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.
Constructs a QCanvasView which views canvas. The usual QWidget parameters may also be supplied.
Destructs the view. The associated canvas is not deleted.
Returns the canvas which the view is currently viewing.
[virtual protected]
Repaints the appropriate area of the QCanvas which this QCanvasView is viewing.
Reimplemented from QScrollView.
Changes the QCanvas which the QCanvasView is viewing to canvas.
[virtual protected]
Suggests a size sufficient to view the entire canvas.
Reimplemented from QWidget.
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright © 2000 Trolltech | Trademarks | Qt version 2.2.1
|