📄 qcanvasview.3qt
字号:
.TH QCanvasView 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQCanvasView \- A QWidget which views a QCanvas<h1 align=center>QCanvasView Class Reference.br<small>[ canvas module ]</small></h1>.br.PP\fC#include <qcanvas.h>\fR.PPInherits QScrollView..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQCanvasView\fR ( QCanvas * " "viewing" "=0, QWidget * " "parent" "=0, const char * " "name" "=0, WFlags " "f" "=0 ) ".br.ti -1c.BI "\fB~QCanvasView\fR () ".br.ti -1c.BI "QCanvas* \fBcanvas\fR () const".br.ti -1c.BI "void \fBsetCanvas\fR ( QCanvas * v ) ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter *, int " "cx" ", int " "cy" ", int " "cw" ", int ch ) ".br.ti -1c.BI "virtual QSize \fBsizeHint\fR () const".br.in -1c.SH DESCRIPTIONA QWidget which views a QCanvas..PPDisplays a view of a QCanvas, with scrollbars available if desired. There can be more than one view of a canvas..PPThe 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..PP.nf.br void MyCanvasView::contentsMousePressEvent(QMouseEvent* e).br {.br QCanvasItemList list = canvas()->collisions(e->pos());.br if ( !list.isEmpty() ) {.br QCanvasItem* item = list.first();.br.br // Process the top item.br ....br }.br }.fi.PPMost of the functionality of QCanvasView is the functionality available for all QScrollView subclasses..SH MEMBER FUNCTION DOCUMENTATION.SH "QCanvasView::QCanvasView ( QCanvas * canvas=0, QWidget * parent=0, const char * name=0, WFlags f=0 )"Constructs a QCanvasView which views \fIcanvas.\fR The usual QWidget parameters may also be supplied..SH "QCanvasView::~QCanvasView ()"Destructs the view. The associated canvas is \fInot\fR deleted..SH "QCanvas* QCanvasView::canvas () const"Returns the canvas which the view is currently viewing..SH "void QCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch ) \fC[virtual protected]\fR"Repaints the appropriate area of the QCanvas which this QCanvasView is viewing..PPReimplemented from QScrollView..SH "void QCanvasView::setCanvas ( QCanvas * canvas )"Changes the QCanvas which the QCanvasView is viewing to \fIcanvas.\fR.SH "QSize QCanvasView::sizeHint () const \fC[virtual protected]\fR"Suggests a size sufficient to view the entire canvas..PPReimplemented from QWidget..SH "SEE ALSO".BR http://doc.trolltech.com/qcanvasview.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -