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

📄 qscrollview.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 3 页
字号:
.(lscrollview/scrollview.cpp.)l.SH "bool QScrollView::hasStaticBackground () const"Returns wether QScrollView uses a static background..PPSee also setStaticBackground()..SH "QScrollBar* QScrollView::horizontalScrollBar () const"Returns the component horizontal scrollbar. It is made available to allow accelerators, autoscrolling, etc., and to allow changing of arrow scroll rates: bar->setSteps( rate, bar->pageStep() )..PPIt should not be otherwise manipulated..PPThis function never returns 0..SH "int QScrollView::leftMargin () const \fC[protected]\fR"Returns the current left margin..PPSee also setMargins()..SH "QSize QScrollView::minimumSizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollView::moveChild ( QWidget * child, int x, int y ) \fC[virtual]\fR"Repositions \fIchild\fR to (\fIx, y).\fR This functions the same as addChild()..SH "void QScrollView::removeChild ( QObject * child ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QObject..SH "void QScrollView::removeChild ( QWidget * child )"Removes a child from the scrolled area. Note that this happens automatically if the child is deleted..SH "void QScrollView::repaintContents ( int x, int y, int w, int h, bool erase=TRUE )"Calls repaint() on rectangle defined by \fIx, y, w, h,\fR translated appropriately. If the rectangle in not visible, nothing is repainted..PPSee also updateContents()..SH "void QScrollView::repaintContents ( const QRect & r, bool erase=TRUE )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "void QScrollView::resize ( const QSize & s )"Reimplemented for internal reasons; the API is not affected..PPExamples:.(liconview/main.cpp dirview/main.cpp.)l.SH "void QScrollView::resize ( int w, int h )"Reimplemented for internal reasons; the API is not affected..SH "void QScrollView::resizeContents ( int w, int h ) \fC[virtual slot]\fR"Set the size of the contents area to \fIw\fR pixels wide and \fIh\fR pixels high, and updates the viewport accordingly..SH "void QScrollView::resizeEvent ( QResizeEvent * event ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QScrollView::ResizePolicy QScrollView::resizePolicy() const"Returns the currently set ResizePolicy..PPSee also setResizePolicy() and ResizePolicy..SH "int QScrollView::rightMargin () const \fC[protected]\fR"Returns the current right margin..PPSee also setMargins()..SH "void QScrollView::scrollBy ( int dx, int dy ) \fC[slot]\fR"Scrolls the content by \fIdx\fR to the left and \fIdy\fR upwards..SH "void QScrollView::setContentsPos ( int x, int y ) \fC[virtual slot]\fR"Scrolls the content so that the point (x, y) is in the top-left corner..PPReimplemented in QListView..SH "void QScrollView::setCornerWidget ( QWidget * corner ) \fC[virtual]\fR"Sets the widget in the corner between the two scrollbars..PPYou will probably also want to set at least one of the scrollbar modes to AlwaysOn..PPPassing 0 shows no widget in the corner..PPAny previous corner widget is hidden..PPYou may call setCornerWidget() with the same widget at different times..PPAll widgets set here will be deleted by the QScrollView when it destructs unless you separately reparent the widget after setting some other corner widget (or 0)..PPAny \fInewly\fR set widget should have no current parent..PPBy default, no corner widget is present..PPSee also setVScrollBarMode() and setHScrollBarMode()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QScrollView::setDragAutoScroll ( bool b )"If \fIb\fR is set to TRUE, the QScrollView automatically scrolls the contents in drag move events if the user moves the cursor close to a border of the view. This of course only works id the viewport accepts drops! Specifying FALSE here disables this autoscroll feature..SH "void QScrollView::setEnabled ( bool enable ) \fC[virtual slot]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollView::setHBarGeometry ( QScrollBar & hbar, int x, int y, int w, int h ) \fC[virtual protected]\fR"Called when the horizontal scrollbar geometry changes. This is provided as a protected function so that subclasses can do interesting things like providing extra buttons in some of the space normally used by the scrollbars..PPThe default implementation simply gives all the space to \fIhbar.\fR.PPSee also setVBarGeometry()..SH "void QScrollView::setHScrollBarMode ( ScrollBarMode mode )"Sets the mode for the horizontal scrollbar..TP\fCAuto\fR (the default) shows a scrollbar when the content is too wide to fit..TP\fCAlwaysOff\fR never shows a scrollbar..TP\fCAlwaysOn\fR always shows a scrollbar..PPSee also hScrollBarMode() and setVScrollBarMode()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QScrollView::setMargins ( int left, int top, int right, int bottom ) \fC[virtual protected]\fR"Sets the margins around the scrolling area. This is useful for applications such as spreadsheets with `locked' rows and columns. The marginal space is \fIinside\fR the frameRect() and is left blank - reimplement drawContents() or put widgets in the unused area..PPBy default all margins are zero..PPSee also frameChanged()..SH "void QScrollView::setResizePolicy ( ResizePolicy r )"Sets the resize policy to \fIr.\fR.PPSee also resizePolicy() and ResizePolicy..SH "void QScrollView::setStaticBackground ( bool y )"Sets the scrollview to have a static background if \fIy\fR is TRUE, or a scrolling background otherwise. By default, the background is scrolling..PPBeware that this mode is quite slow, as a full repaint of the visible area has to be triggered on every contents move..PPSee also hasStaticBackground()..SH "void QScrollView::setVBarGeometry ( QScrollBar & vbar, int x, int y, int w, int h ) \fC[virtual protected]\fR"Called when the vertical scrollbar geometry changes. This is provided as a protected function so that subclasses can do interesting things like providing extra buttons in some of the space normally used by the scrollbars..PPThe default implementation simply gives all the space to \fIvbar.\fR.PPSee also setHBarGeometry()..SH "void QScrollView::setVScrollBarMode ( ScrollBarMode mode )"Sets the mode for the vertical scrollbar..PPSee also vScrollBarMode() and setHScrollBarMode()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QScrollView::show () \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPExamples:.(liconview/main.cpp.)l.PPReimplemented from QWidget..SH "void QScrollView::showChild ( QWidget * child, bool y=TRUE )"\fBThis function is obsolete.\fR It is provided to keep old source working, and will probably be removed in a future version of Qt. We strongly advise against using it in new code..PPSets the visibility of \fIchild.\fR Equivalent to QWidget::show() or QWidget::hide()..SH "QSize QScrollView::sizeHint () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QSizePolicy QScrollView::sizePolicy () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QScrollView::styleChange ( QStyle & old ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "int QScrollView::topMargin () const \fC[protected]\fR"Returns the current top margin..PPSee also setMargins()..SH "void QScrollView::updateContents ( int x, int y, int w, int h )"Calls update() on rectangle defined by \fIx, y, w, h,\fR translated appropriately. If the rectangle in not visible, nothing is repainted..PPSee also repaintContents()..SH "void QScrollView::updateContents ( const QRect & r )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "void QScrollView::updateScrollBars () \fC[slot]\fR"Updates scrollbars - all possibilities considered. You should never need to call this in your code..SH "QScrollView::ScrollBarMode QScrollView::vScrollBarMode() const"Returns the currently set mode for the vertical scrollbar..PPSee also setVScrollBarMode()..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "QScrollBar* QScrollView::verticalScrollBar () const"Returns the component vertical scrollbar. It is made available to allow accelerators, autoscrolling, etc., and to allow changing of arrow scroll rates: bar->setSteps( rate, bar->pageStep() )..PPIt should not be otherwise manipulated..PPThis function never returns 0..SH "QWidget* QScrollView::viewport () const"Returns the viewport widget of the scrollview. This is the widget containing the contents widget or which is the drawing area..PPExamples:.(lscrollview/scrollview.cpp.)l.SH "void QScrollView::viewportDragEnterEvent ( QDragEnterEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all drag enter events sent to the viewport..PPThe default implementation translates the event and calls contentsDragEnterEvent()..PPSee also QWidget::dragEnterEvent()..SH "void QScrollView::viewportDragLeaveEvent ( QDragLeaveEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all drag leave events sent to the viewport..PPThe default implementation calls contentsDragLeaveEvent()..PPSee also QWidget::dragLeaveEvent()..SH "void QScrollView::viewportDragMoveEvent ( QDragMoveEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all drag move events sent to the viewport..PPThe default implementation translates the event and calls contentsDragMoveEvent()..PPSee also QWidget::dragMoveEvent()..SH "void QScrollView::viewportDropEvent ( QDropEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all drop events sent to the viewport..PPThe default implementation translates the event and calls contentsDropEvent()..PPSee also QWidget::dropEvent()..SH "void QScrollView::viewportMouseDoubleClickEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all mouse double click events sent to the viewport..PPThe default implementation translates the event and calls contentsMouseDoubleClickEvent()..PPSee also QWidget::mouseDoubleClickEvent()..PPReimplemented in QListBox..SH "void QScrollView::viewportMouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all mouse move events sent to the viewport..PPThe default implementation translates the event and calls contentsMouseMoveEvent()..PPSee also QWidget::mouseMoveEvent()..PPReimplemented in QTextView, QTextBrowser and QListBox..SH "void QScrollView::viewportMousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all mouse press events sent to the viewport..PPThe default implementation translates the event and calls contentsMousePressEvent()..PPSee also contentsMousePressEvent() and QWidget::mousePressEvent()..PPReimplemented in QTextView, QListBox and QTextBrowser..SH "void QScrollView::viewportMouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all mouse release events sent to the viewport..PPThe default implementation translates the event and calls contentsMouseReleaseEvent()..PPSee also QWidget::mouseReleaseEvent()..PPReimplemented in QTextBrowser, QTextView and QListBox..SH "void QScrollView::viewportPaintEvent ( QPaintEvent * pe ) \fC[virtual protected]\fR"This is a low-level painting routine that draws the viewport contents. Reimplement this if drawContents() is too high-level. (for example, if you don't want to open a QPainter on the viewport)..PPReimplemented in QListBox..SH "void QScrollView::viewportResizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all resize events sent to the viewport..PPSee also QWidget::resizeEvent()..PPReimplemented in QTextView..SH "QSize QScrollView::viewportSize ( int x, int y ) const"Returns the viewport size for size (\fIx, y).\fR.PPThe viewport size depends on \fIx,y\fR (the size of the contents), the size of this widget, the modes of the horizontal and vertical scroll bars..PPThis function permits widgets that can trade vertical and horizontal space for each other to control scroll bar appearance better. For example, a word processor or web browser can control the width of the right margin accurately, whether there needs to be a vertical scroll bar or not..SH "QPoint QScrollView::viewportToContents ( const QPoint & vp )"Returns the point on the viewport \fIvp\fR translated to a point in the contents..SH "void QScrollView::viewportToContents ( int vx, int vy, int & x, int & y )"Translates a point (\fIvx, vy)\fR on the viewport() widget to a point (\fIx, y)\fR in the contents..SH "void QScrollView::viewportWheelEvent ( QWheelEvent * e ) \fC[virtual protected]\fR"To provide simple processing of events on the contents, this method receives all wheel events sent to the viewport..PPThe default implementation translates the event and calls contentsWheelEvent()..PPSee also QWidget::wheelEvent()..SH "int QScrollView::visibleHeight () const"Returns the vertical amount of the content that is visible..SH "int QScrollView::visibleWidth () const"Returns the horizontal amount of the content that is visible..SH "void QScrollView::wheelEvent ( QWheelEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "SEE ALSO".BR http://doc.trolltech.com/qscrollview.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qscrollview.3qt) and the Qtversion (2.3.10).

⌨️ 快捷键说明

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