亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qscrollview.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qscrollview.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QScrollView class**** Created : 950524**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the widgets module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "qwidget.h"#ifndef QT_NO_SCROLLVIEW#include "qscrollbar.h"#include "qobjectlist.h"#include "qobjectdict.h"#include "qpainter.h"#include "qpixmap.h"#include "qfocusdata.h"#include "qscrollview.h"#include "qptrdict.h"#include "qapplication.h"#include "qtimer.h"#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endifconst int coord_limit = 4000;static const int autoscroll_margin = 16;static const int initialScrollTime = 30;static const int initialScrollAccel = 5;struct QSVChildRec {    QSVChildRec(QWidget* c, int xx, int yy) :	child(c),	x(xx), y(yy)    {    }    void moveBy(QScrollView* sv, int dx, int dy, QWidget* clipped_viewport)    {	moveTo( sv, x+dx, y+dy, clipped_viewport );    }    void moveTo(QScrollView* sv, int xx, int yy, QWidget* clipped_viewport)    {	if ( x != xx || y != yy ) {	    x = xx;	    y = yy;	    hideOrShow(sv,clipped_viewport);	}    }    void hideOrShow(QScrollView* sv, QWidget* clipped_viewport)    {	if ( clipped_viewport ) {	    if ( x+child->width() < sv->contentsX()+clipped_viewport->x()	      || x > sv->contentsX()+clipped_viewport->width()	      || y+child->height() < sv->contentsY()+clipped_viewport->y()	      || y > sv->contentsY()+clipped_viewport->height() )	    {		child->move(clipped_viewport->width(),			    clipped_viewport->height());	    } else {		child->move(x-sv->contentsX()-clipped_viewport->x(),			    y-sv->contentsY()-clipped_viewport->y());	    }	} else {	    child->move(x-sv->contentsX(), y-sv->contentsY());	}    }    QWidget* child;    int x, y;};class QClipperWidget : public QWidget {public:    QClipperWidget( QWidget * parent=0, const char * name=0, WFlags f=0 )        : QWidget ( parent,name,f) { blockFocus = FALSE; }    bool focusNextPrevChild( bool next ) {	if ( !blockFocus )	    return QWidget::focusNextPrevChild( next );	else	    return TRUE;    }    bool blockFocus;};struct QScrollViewData {    QScrollViewData(QWidget* parent, int vpwflags) :	hbar( QScrollBar::Horizontal, parent, "qt_hbar" ),	vbar( QScrollBar::Vertical, parent, "qt_vbar" ),	viewport( parent, "qt_viewport", vpwflags ),	clipped_viewport( 0 ),	flags( vpwflags ),	vx( 0 ), vy( 0 ), vwidth( 1 ), vheight( 1 )#ifndef QT_NO_DRAGANDDROP	, autoscroll_timer( parent ), drag_autoscroll( TRUE )#endif    {	l_marg = r_marg = t_marg = b_marg = 0;	viewport.setBackgroundMode( QWidget::PaletteDark );	vMode = QScrollView::Auto;	hMode = QScrollView::Auto;	corner = 0;	vbar.setSteps( 20, 1/*set later*/ );	hbar.setSteps( 20, 1/*set later*/ );	policy = QScrollView::Default;	signal_choke = FALSE;	static_bg = FALSE;    }    ~QScrollViewData()    {	deleteAll();    }    QSVChildRec* rec(QWidget* w) { return childDict.find(w); }    QSVChildRec* ancestorRec(QWidget* w)    {	if ( clipped_viewport ) {	    while (w->parentWidget() != clipped_viewport) {		w = w->parentWidget();		if (!w) return 0;	    }	} else {	    while (w->parentWidget() != &viewport) {		w = w->parentWidget();		if (!w) return 0;	    }	}	return rec(w);    }    QSVChildRec* addChildRec(QWidget* w, int x, int y )    {	QSVChildRec *r = new QSVChildRec(w,x,y);	children.append(r);	childDict.insert(w, r);	return r;    }    void deleteChildRec(QSVChildRec* r)    {	childDict.remove(r->child);	children.removeRef(r);	delete r;    }    void hideOrShowAll(QScrollView* sv, bool isScroll = FALSE )    {        if ( clipped_viewport ) {	    if ( clipped_viewport->x() <= 0		 && clipped_viewport->y() <= 0		 && clipped_viewport->width()+clipped_viewport->x() >=		 viewport.width()		 && clipped_viewport->height()+clipped_viewport->y() >=		 viewport.height() ) {		// clipped_viewport still covers viewport		if( static_bg )		    clipped_viewport->repaint( clipped_viewport->visibleRect(), TRUE );		else if ( ( !isScroll && !clipped_viewport->testWFlags( Qt::WNorthWestGravity) ) || static_bg )		    QApplication::postEvent( clipped_viewport, new QPaintEvent( clipped_viewport->visibleRect(),										!clipped_viewport->testWFlags(Qt::WResizeNoErase) ) );	    } else {		// Re-center		int nx = ( viewport.width() - clipped_viewport->width() ) / 2;		int ny = ( viewport.height() - clipped_viewport->height() ) / 2;		// hide the clipped_viewport while we mess around		// with it. To avoid having the focus jumping		// around, we block it.		clipped_viewport->blockFocus = TRUE;		clipped_viewport->hide();		clipped_viewport->move(nx,ny);		clipped_viewport->blockFocus = FALSE;		// no need to update, we'll receive a paintevent after show.	    }	    for (QSVChildRec *r = children.first(); r; r=children.next()) {		r->hideOrShow(sv, clipped_viewport);	    }	    clipped_viewport->show();	}    }    void moveAllBy(int dx, int dy)    {	if ( clipped_viewport && !static_bg ) {	    clipped_viewport->move(		clipped_viewport->x()+dx,		clipped_viewport->y()+dy	    );	} else {	    for (QSVChildRec *r = children.first(); r; r=children.next()) {		r->child->move(r->child->x()+dx,r->child->y()+dy);	    }	    if ( static_bg )		viewport.repaint( viewport.visibleRect(), TRUE );	}    }    void deleteAll()    {	for (QSVChildRec *r = children.first(); r; r=children.next()) {	    delete r;	}    }    bool anyVisibleChildren()    {	for (QSVChildRec *r = children.first(); r; r=children.next()) {	    if (r->child->isVisible()) return TRUE;	}	return FALSE;    }    void autoMove(QScrollView* sv)    {	if ( policy == QScrollView::AutoOne ) {	    QSVChildRec* r = children.first();	    if (r)	        sv->setContentsPos(-r->child->x(),-r->child->y());	}    }    void autoResize(QScrollView* sv)    {	if ( policy == QScrollView::AutoOne ) {	    QSVChildRec* r = children.first();	    if (r)		sv->resizeContents(r->child->width(),r->child->height());	}    }    void autoResizeHint(QScrollView* sv)    {	if ( policy == QScrollView::AutoOne ) {	    QSVChildRec* r = children.first();	    if (r) {                QSize s = r->child->sizeHint();	        if ( s.isValid() )		    r->child->resize(s);	    }	} else if ( policy == QScrollView::AutoOneFit ) {	    QSVChildRec* r = children.first();	    if (r) {		QSize sh = r->child->sizeHint();		sh = sh.boundedTo( r->child->maximumSize() );	        sv->resizeContents( sh.width(), sh.height() );	    }	}    }    void viewportResized( int w, int h ) {	if ( policy == QScrollView::AutoOneFit ) {	    QSVChildRec* r = children.first();	    if (r) {		QSize sh = r->child->sizeHint();		sh = sh.boundedTo( r->child->maximumSize() );		r->child->resize( QMAX(w,sh.width()), QMAX(h,sh.height()) );	    }	}    }    QScrollBar	hbar;    QScrollBar	vbar;    QWidget	viewport;    QClipperWidget*    clipped_viewport;    int		flags;    QList<QSVChildRec>	children;    QPtrDict<QSVChildRec>	childDict;    QWidget*	corner;    int		vx, vy, vwidth, vheight; // for drawContents-style usage    int		l_marg, r_marg, t_marg, b_marg;    QScrollView::ResizePolicy policy;    QScrollView::ScrollBarMode	vMode;    QScrollView::ScrollBarMode	hMode;#ifndef QT_NO_DRAGANDDROP    QPoint cpDragStart;    QTimer autoscroll_timer;    int autoscroll_time;    int autoscroll_accel;    bool drag_autoscroll;#endif    bool static_bg;    // This variable allows ensureVisible to move the contents then    // update both the sliders.  Otherwise, updating the sliders would    // cause two image scrolls, creating ugly flashing.    //    bool signal_choke;};// NOT REVISED/*!\class QScrollView qscrollview.h\brief The QScrollView widget provides a scrolling area with on-demand scrollbars.\ingroup abstractwidgetsThe QScrollView is a large canvas - potentially larger than thecoordinate 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 aroundwith the drawn content.  These subwidgets can also have positionsoutside the normal coordinate range (but they are still limited insize).To provide content for the widget, inherit from QScrollView andreimplement drawContents(), and use resizeContents() to set the sizeof the viewed area.  Use addChild() / moveChild() to position widgetson the view.To use QScrollView effectively, it is important to understand itswidget 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.<dl><dt><b>One Big Widget</b><dd><img src=qscrollview-vp2.png>The first, simplest usage of QScrollView depicted above isappropriate for scrolling areaswhich are \e never more than about 4000 pixels in either dimension (thisis about the maximum reliable size on X11 servers).  In this usage, youjust make one large child in the QScrollView.  The child shouldbe a child of the viewport() of the scrollview, and be added with addChild():\code    QScrollView* sv = new QScrollView(...);    QVBox* big_box = new QVBox(sv->viewport());    sv->addChild(big_box);\endcodeYou may go on to add arbitrary child widgets to the single child inthe scrollview, as you would with any widget:\code    QLabel* child1 = new QLabel("CHILD", big_box);    QLabel* child2 = new QLabel("CHILD", big_box);    QLabel* child3 = new QLabel("CHILD", big_box);    ...\endcodeHere, the QScrollView has 4 children - the viewport(),the verticalScrollBar(), the horizontalScrollBar(), anda small cornerWidget().  The viewport() has 1 child, the big QVBox.The QVBox has the three labels as child widgets.  When the view is scrolled,the QVBox is moved, and its children move with it as child widgets normallydo.<dt><b>Very Big View, some Widgets</b><dd><img src=qscrollview-vp.png>The second usage of QScrollView depicted above is appropriate whenfew, if any, widgets are on a very large scrolling area that ispotentially larger than 4000 pixels in either dimension. In thisusage, you call resizeContents() to set the size of the area, andreimplement drawContents() to paint the contents.  You may also addsome widgets, by making them children of the viewport() and addingthem with addChild() (this is the same as the process for the singlelarge widget in the previous example): \code    QScrollView* sv = new QScrollView(...);    QLabel* child1 = new QLabel("CHILD", sv->viewport());    sv->addChild(child1);    QLabel* child2 = new QLabel("CHILD", sv->viewport());    sv->addChild(child2);    QLabel* child3 = new QLabel("CHILD", sv->viewport());    sv->addChild(child3);\endcodeHere, the QScrollView has the same 4 children - the viewport(),the verticalScrollBar(), the horizontalScrollBar(), anda small cornerWidget().  The viewport()has the three labels as child widgets.  When the view is scrolled,the scrollview moves the child widgets individually.<dt><b>Very Big View, many Widgets</b><dd><img src=qscrollview-cl.png>The final usage of QScrollView depicted above isappropriate when many widgets are on a very large scrolling areathat is potentially larger than 4000 pixels in either dimension. In thisusage, you call resizeContents() to set the size of the area, and reimplementdrawContents() to paint the contents.  You then call enableClipper(TRUE)and add widgets, againby making them children of the viewport() and adding them withaddChild():\code    QScrollView* sv = new QScrollView(...);    sv->enableClipper(TRUE);    QLabel* child1 = new QLabel("CHILD", sv->viewport());    sv->addChild(child1);    QLabel* child2 = new QLabel("CHILD", sv->viewport());    sv->addChild(child2);    QLabel* child3 = new QLabel("CHILD", sv->viewport());    sv->addChild(child3);\endcodeHere, the QScrollView has 4 children - the clipper() (\e not theviewport() this time), the verticalScrollBar(), thehorizontalScrollBar(), and a small cornerWidget().  The clipper() has1 child - the viewport().  The viewport() has the three labels aschild widgets.  When the view is scrolled, the viewport() is moved,and its children move with it as child widgets normally do.</dl>Normally you will use the first or third method if you want any childwidgets in the view.Note that the widget you see in the scrolled area is the viewport()widget, not the QScrollView itself.  So, to turn mouse tracking on forexample, use viewport()->setMouseTracking(TRUE).To enable drag-and-drop, you would setAcceptDrops(TRUE) on theQScrollView (since drag-and-drop events propagate to the parent), butto work out what logical position in the view, you would need to mapthe drop co-ordinate from being relative to the QScrollView to beingrelative to the contents - use the function viewportToContents() for this.To handle mouse events on the scrolling area, subclass scrollview asyou would subclass other widgets, but rather than overridingmousePressEvent(), reimplement viewportMousePressEvent() instead (ifyou reimplement mousePressEvent() you'll only get called when part of theQScrollView is clicked - and the only such part is the "corner" (ifyou don't set a cornerWidget()) and the frame, everything else beingcovered up by the viewport, clipper, or scrollbars.When you construct a QScrollView, some of the widget flags apply to theviewport(), instead of being sent to the QWidget constructor for theQScrollView. This applies to \c WResizeNoErase, \c WNorthWestGravity,\c WRepaintNoErase and \c WPaintClever. See Qt::WidgetFlags fordocumentation about these flags.  Here are some examples: <ul><li> An image manipulation widget would use \cWResizeNoErase|WNorthWestGravity, because the widget draws all pixelsitself and when the size increases, it only needs a paint event forthe new part, since the old part remains unchanged.<li>A word processing widget might use \c WResizeNoErase and repaintitself line by line to get a less flickery resizing. If the widget isin a mode where no text justification can take place, it might use \cWNorthWestGravity too, so that it would only get a repaint for thenewly visible parts.<li>A scrolling game widget where the background scrolls as thecharacters move might use \c WRepaintNoErase (in addition to \cWNorthWestGravity and \c WResizeNoErase) so that the window systembackground does not flash in and out during scrolling.</ul>\warning WResizeNoErase is currently set by default, i.e. you alwayshave to clear the background manually in scrollview subclasses. Thiswill change in a future version of Qt, and we recommend specifying theflag explicitly.<img src=qscrollview-m.png> <img src=qscrollview-w.png>*//*! \enum QScrollView::ResizePolicy  This enum type is used to control QScrollView's reaction to resize  events.  There are four possible settings:<ul>  <li> \c Default - QScrollView selects one of the other settings  automatically when it has to.  In this version of Qt, QScrollView  changes to \c Manual if you resize the contents with  resizeContents(), and to \c AutoOne if a child is added.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久三级| 久久精品国产在热久久| 国产成人免费视| 久久久久国产精品厨房| 国内精品不卡在线| 中文字幕免费不卡在线| 精品国产成人系列| 国产激情一区二区三区| 国产精品免费视频一区| 94色蜜桃网一区二区三区| 国产精品久久午夜| 欧美综合天天夜夜久久| 日韩av一二三| 久久久亚洲欧洲日产国码αv| 国产精品香蕉一区二区三区| 欧美精品自拍偷拍| 亚洲午夜久久久久久久久电影网 | 日本成人在线不卡视频| 欧美一区二区精品久久911| 极品少妇xxxx精品少妇偷拍| 国产免费成人在线视频| 91在线视频免费观看| 亚洲午夜在线电影| 精品精品欲导航| 成人av网站大全| 午夜精品视频一区| 国产精品一二一区| 亚洲一区自拍偷拍| 2021久久国产精品不只是精品| 国产高清精品在线| 亚洲成人一区在线| 国产亚洲一区二区在线观看| 91高清在线观看| 六月丁香婷婷色狠狠久久| 亚洲视频综合在线| 精品99999| 日韩激情中文字幕| av亚洲精华国产精华| 欧美最猛性xxxxx直播| 免费人成精品欧美精品| 亚洲欧洲国产日韩| 精品日韩欧美一区二区| 色88888久久久久久影院按摩| 天天综合色天天综合色h| 国产女人水真多18毛片18精品视频| 欧美日韩综合在线| 91原创在线视频| 久久国产人妖系列| 天堂在线亚洲视频| 午夜视频在线观看一区二区| 五月婷婷激情综合| 视频在线在亚洲| 欧美aaa在线| 欧美xxxxxxxx| 亚洲成人午夜影院| 国产高清成人在线| 69堂国产成人免费视频| 国产欧美一区二区精品久导航| 一区二区欧美国产| 国产精品996| 欧美国产一区二区在线观看| 色综合天天综合网天天狠天天 | 亚洲色图都市小说| 国产亚洲精品bt天堂精选| 欧美一区二区三区系列电影| 欧美视频你懂的| 91麻豆精东视频| kk眼镜猥琐国模调教系列一区二区| 激情久久久久久久久久久久久久久久 | 成人午夜在线播放| 在线观看亚洲专区| 色综合久久中文综合久久97 | 成人av在线电影| 国产精品99久久久久久有的能看| 日本成人在线看| 日本女优在线视频一区二区| 偷拍一区二区三区| 天天综合网天天综合色| 日韩专区在线视频| 日韩av电影免费观看高清完整版在线观看| 伊人夜夜躁av伊人久久| 一二三区精品视频| 一区二区三区在线观看欧美| 亚洲一区成人在线| 亚洲成av人片一区二区| 视频一区二区三区在线| 奇米精品一区二区三区在线观看| 国产sm精品调教视频网站| 精品一区二区免费| 国产精品一区二区久久精品爱涩| 国产精品久久久久影院色老大| 日本一区二区三区在线观看| 国产精品国产精品国产专区不片 | 亚洲精品成人在线| 一区二区在线观看视频| 亚洲成人av一区二区| 日本视频在线一区| 国产一区二区三区久久久| 成人一区二区三区视频| 91蜜桃免费观看视频| 欧美午夜精品免费| 欧美成人三级电影在线| 亚洲国产成人午夜在线一区| 亚洲欧洲制服丝袜| 日韩黄色小视频| 国产尤物一区二区在线| 91在线播放网址| 日韩一区二区三区观看| 欧美国产日韩a欧美在线观看| 亚洲人123区| 日本亚洲视频在线| 丁香天五香天堂综合| 成人福利视频网站| 欧美人牲a欧美精品| 精品对白一区国产伦| 亚洲欧美成人一区二区三区| 蜜臀久久99精品久久久久久9 | 国产精品一区二区黑丝| 成人h版在线观看| 欧美丰满高潮xxxx喷水动漫| 国产清纯在线一区二区www| 一区二区在线观看免费| 麻豆专区一区二区三区四区五区| 国产成人免费在线视频| 欧美伊人久久久久久久久影院| 精品国产污网站| 亚洲综合免费观看高清完整版| 激情综合五月婷婷| 在线影视一区二区三区| 国产日韩av一区二区| 日韩制服丝袜av| 97se狠狠狠综合亚洲狠狠| 欧美xxxxx裸体时装秀| 亚洲午夜一区二区三区| 成人禁用看黄a在线| 欧美日韩国产大片| 中文字幕欧美一| 国产美女精品人人做人人爽| 欧美在线不卡视频| 国产精品久久午夜| 国产精品一区二区男女羞羞无遮挡| 在线看一区二区| 国产精品国产三级国产a| 国产精品一区二区x88av| 欧美一级专区免费大片| 亚洲视频一二三| 成人中文字幕合集| 日韩欧美另类在线| 亚洲福利视频一区二区| 色婷婷精品久久二区二区蜜臀av| 国产女人18水真多18精品一级做| 蜜桃视频一区二区三区在线观看| 欧美视频在线一区二区三区| 亚洲视频在线一区观看| 成人免费视频免费观看| 久久蜜桃香蕉精品一区二区三区| 日韩不卡手机在线v区| 欧美撒尿777hd撒尿| 亚洲精品国产精品乱码不99| www.欧美色图| 中文字幕不卡在线| 福利电影一区二区三区| 国产欧美一区视频| 国产精品一区二区在线观看网站| 精品播放一区二区| 成人自拍视频在线| 国产精品亚洲а∨天堂免在线| 91精品国产福利在线观看| 亚洲成人av资源| 欧美理论在线播放| 日韩中文欧美在线| 欧美变态tickle挠乳网站| 秋霞影院一区二区| 日韩三级中文字幕| 国精产品一区一区三区mba视频| 精品少妇一区二区三区| 国产综合色精品一区二区三区| 91精品国产高清一区二区三区| 免费在线视频一区| 欧美精品一区二区三区在线播放 | 久久久影视传媒| 成人综合激情网| 国产精品每日更新| 91社区在线播放| 婷婷六月综合网| 精品国产露脸精彩对白 | 国产精品无圣光一区二区| 成人毛片视频在线观看| 亚洲乱码精品一二三四区日韩在线| 99久久99久久综合| 夜夜操天天操亚洲| 欧美日韩免费不卡视频一区二区三区| 五月天一区二区| 久久久九九九九| 色综合视频在线观看| 日韩av电影免费观看高清完整版| 精品福利视频一区二区三区| 91网站在线播放| 欧美a一区二区| 国产精品久久久久一区|