⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qscrollview.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.TH QScrollView 3qt "3 September 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 NAMEQScrollView \- Scrolling area with on-demand scrollbars.SH SYNOPSIS.br.PP\fC#include <qscrollview.h>\fR.PPInherits QFrame..PPInherited by QCanvasView, QIconView, QListBox, QListView, QTable and QTextView..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQScrollView\fR ( QWidget * " "parent" "=0, const char * " "name" "=0, WFlags " "f" "=0 ) ".br.ti -1c.BI "\fB~QScrollView\fR () ".br.ti -1c.BI "enum \fBResizePolicy\fR { Default, Manual, AutoOne }".br.ti -1c.BI "virtual void \fBsetResizePolicy\fR ( ResizePolicy ) ".br.ti -1c.BI "ResizePolicy \fBresizePolicy\fR () const".br.ti -1c.BI "void \fBremoveChild\fR ( QWidget * child ) ".br.ti -1c.BI "virtual void \fBaddChild\fR ( QWidget * " "child" ", int " "x" "=0, int " "y" "=0 ) ".br.ti -1c.BI "virtual void \fBmoveChild\fR ( QWidget * " "child" ", int " "x" ", int y ) ".br.ti -1c.BI "int \fBchildX\fR ( QWidget * child ) ".br.ti -1c.BI "int \fBchildY\fR ( QWidget * child ) ".br.ti -1c.BI "bool childIsVisible ( QWidget * child ) \fI(obsolete)\fR".br.ti -1c.BI "void showChild ( QWidget * " "child" ", bool " "yes" "=TRUE ) \fI(obsolete)\fR".br.ti -1c.BI "enum \fBScrollBarMode\fR { Auto, AlwaysOff, AlwaysOn }".br.ti -1c.BI "ScrollBarMode \fBvScrollBarMode\fR () const".br.ti -1c.BI "virtual void \fBsetVScrollBarMode\fR ( ScrollBarMode ) ".br.ti -1c.BI "ScrollBarMode \fBhScrollBarMode\fR () const".br.ti -1c.BI "virtual void \fBsetHScrollBarMode\fR ( ScrollBarMode ) ".br.ti -1c.BI "QWidget* \fBcornerWidget\fR () const".br.ti -1c.BI "virtual void \fBsetCornerWidget\fR ( QWidget * ) ".br.ti -1c.BI "QScrollBar* \fBhorizontalScrollBar\fR () const".br.ti -1c.BI "QScrollBar* \fBverticalScrollBar\fR () const".br.ti -1c.BI "QWidget* \fBviewport\fR () const".br.ti -1c.BI "QWidget* \fBclipper\fR () const".br.ti -1c.BI "int \fBvisibleWidth\fR () const".br.ti -1c.BI "int \fBvisibleHeight\fR () const".br.ti -1c.BI "int \fBcontentsWidth\fR () const".br.ti -1c.BI "int \fBcontentsHeight\fR () const".br.ti -1c.BI "int \fBcontentsX\fR () const".br.ti -1c.BI "int \fBcontentsY\fR () const".br.ti -1c.BI "void \fBupdateContents\fR ( int " "x" ", int " "y" ", int " "w" ", int h ) ".br.ti -1c.BI "void \fBupdateContents\fR ( const QRect & r ) ".br.ti -1c.BI "void \fBrepaintContents\fR ( int " "x" ", int " "y" ", int " "w" ", int " "h" ", bool " "erase" "=TRUE ) ".br.ti -1c.BI "void \fBrepaintContents\fR ( const QRect & " "r" ", bool " "erase" "=TRUE ) ".br.ti -1c.BI "void \fBcontentsToViewport\fR ( int " "x" ", int " "y" ", int & " "vx" ", int & vy ) ".br.ti -1c.BI "void \fBviewportToContents\fR ( int " "vx" ", int " "vy" ", int & " "x" ", int & y ) ".br.ti -1c.BI "QPoint \fBcontentsToViewport\fR ( const QPoint & ) ".br.ti -1c.BI "QPoint \fBviewportToContents\fR ( const QPoint & ) ".br.ti -1c.BI "void \fBenableClipper\fR ( bool y ) ".br.ti -1c.BI "void \fBsetStaticBackground\fR ( bool y ) ".br.ti -1c.BI "bool \fBhasStaticBackground\fR () const".br.ti -1c.BI "QSize \fBviewportSize\fR ( int, int ) const".br.ti -1c.BI "void \fBsetDragAutoScroll\fR ( bool b ) ".br.ti -1c.BI "bool \fBdragAutoScroll\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBresizeContents\fR ( int " "w" ", int h ) ".br.ti -1c.BI "void \fBscrollBy\fR ( int " "dx" ", int dy ) ".br.ti -1c.BI "virtual void \fBsetContentsPos\fR ( int " "x" ", int y ) ".br.ti -1c.BI "void \fBensureVisible\fR ( int " "x" ", int y ) ".br.ti -1c.BI "void \fBensureVisible\fR ( int " "x" ", int " "y" ", int " "xmargin" ", int ymargin ) ".br.ti -1c.BI "void \fBcenter\fR ( int " "x" ", int y ) ".br.ti -1c.BI "void \fBcenter\fR ( int " "x" ", int " "y" ", float " "xmargin" ", float ymargin ) ".br.ti -1c.BI "void \fBupdateScrollBars\fR () ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBcontentsMoving\fR ( int " "x" ", int y ) ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual bool \fBeventFilter\fR ( QObject *, QEvent * e ) ".br.ti -1c.BI "virtual void \fBcontentsMousePressEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsMouseReleaseEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsMouseDoubleClickEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsMouseMoveEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsDragEnterEvent\fR ( QDragEnterEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsDragMoveEvent\fR ( QDragMoveEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsDragLeaveEvent\fR ( QDragLeaveEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsDropEvent\fR ( QDropEvent * ) ".br.ti -1c.BI "virtual void \fBcontentsWheelEvent\fR ( QWheelEvent * ) ".br.ti -1c.BI "virtual void \fBviewportPaintEvent\fR ( QPaintEvent * ) ".br.ti -1c.BI "virtual void \fBviewportResizeEvent\fR ( QResizeEvent * ) ".br.ti -1c.BI "virtual void \fBviewportMousePressEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBviewportMouseReleaseEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBviewportMouseDoubleClickEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBviewportMouseMoveEvent\fR ( QMouseEvent * ) ".br.ti -1c.BI "virtual void \fBviewportDragEnterEvent\fR ( QDragEnterEvent * ) ".br.ti -1c.BI "virtual void \fBviewportDragMoveEvent\fR ( QDragMoveEvent * ) ".br.ti -1c.BI "virtual void \fBviewportDragLeaveEvent\fR ( QDragLeaveEvent * ) ".br.ti -1c.BI "virtual void \fBviewportDropEvent\fR ( QDropEvent * ) ".br.ti -1c.BI "virtual void \fBviewportWheelEvent\fR ( QWheelEvent * ) ".br.ti -1c.BI "virtual void \fBdrawContentsOffset\fR ( QPainter *, int " "ox" ", int " "oy" ", int " "cx" ", int " "cy" ", int " "cw" ", int ch ) ".br.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter *, int " "cx" ", int " "cy" ", int " "cw" ", int ch ) ".br.ti -1c.BI "virtual void \fBsetMargins\fR ( int " "left" ", int " "top" ", int " "right" ", int bottom ) ".br.ti -1c.BI "int \fBleftMargin\fR () const".br.ti -1c.BI "int \fBtopMargin\fR () const".br.ti -1c.BI "int \fBrightMargin\fR () const".br.ti -1c.BI "int \fBbottomMargin\fR () const".br.ti -1c.BI "virtual void \fBsetHBarGeometry\fR ( QScrollBar & " "hbar" ", int " "x" ", int " "y" ", int " "w" ", int h ) ".br.ti -1c.BI "virtual void \fBsetVBarGeometry\fR ( QScrollBar & " "vbar" ", int " "x" ", int " "y" ", int " "w" ", int h ) ".br.in -1c.SS "Properties"<table border=1 cellpadding=3 cellspacing=0> <tr><th>Type<th>Name<th>READ<th>WRITE<th>Options <tr><td>ResizePolicy<td>resizePolicy<td>resizePolicy<td>setResizePolicy<td>&nbsp; <tr><td>ScrollBarMode<td>vScrollBarMode<td>vScrollBarMode<td>setVScrollBarMode<td>&nbsp; <tr><td>ScrollBarMode<td>hScrollBarMode<td>hScrollBarMode<td>setHScrollBarMode<td>&nbsp; <tr><td>int<td>visibleWidth<td>visibleWidth<td>&nbsp;<td>&nbsp; <tr><td>int<td>visibleHeight<td>visibleHeight<td>&nbsp;<td>&nbsp; <tr><td>int<td>contentsWidth<td>contentsWidth<td>&nbsp;<td>&nbsp; <tr><td>int<td>contentsHeight<td>contentsHeight<td>&nbsp;<td>&nbsp; <tr><td>int<td>contentsX<td>contentsX<td>&nbsp;<td>&nbsp; <tr><td>int<td>contentsY<td>contentsY<td>&nbsp;<td>&nbsp; <tr><td>bool<td>dragAutoScroll<td>dragAutoScroll<td>setDragAutoScroll<td>&nbsp; </table>.SH DESCRIPTIONThe QScrollView widget provides a scrolling area with on-demand scrollbars..PPThe QScrollView is a large canvas - potentially larger than the coordinate system normally supported by the underlying window system. This is important, as is is quite easy to go beyond such limitations (eg. many web pages are more than 32000 pixels high). Additionally, the QScrollView can have QWidgets positioned on it that scroll around with the drawn content. These subwidgets can also have positions outside the normal coordinate range (but they are still limited in size)..PPTo provide content for the widget, inherit from QScrollView and reimplement drawContents(), and use resizeContents() to set the size of the viewed area. Use addChild() / moveChild() to position widgets on the view..PPTo use QScrollView effectively, it is important to understand its widget structure in the three styles of usage: a single large child widget, a large panning area with some widgets, a large panning area with many widgets..IP "\fBOne Big Widget\fR" 1c.PP<img src=qscrollview-vp2.png>.PPThe first, simplest usage of QScrollView depicated above is appropriate for scrolling areas which are \fInever\fR more than about 4000 pixels in either dimension (this is about the maximum reliable size on X11 servers). In this usage, you just make one large child in the QScrollView. The child should be a child of the viewport() of the scrollview, and be added with addChild():.PP.nf.br    QScrollView* sv = new QScrollView(...);.br    QVBox* big_box = new QVBox(sv->viewport());.br    sv->addChild(big_box);.fi.PP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -