亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久久亚洲精品一区二区三区| 日本欧洲一区二区| 亚洲免费观看高清完整版在线 | 欧美女孩性生活视频| 欧美不卡在线视频| 亚洲综合久久av| 成人国产精品免费观看动漫| 欧美一区二区在线看| 亚洲日本韩国一区| 国产福利一区二区| 日韩欧美国产一二三区| 亚洲永久精品大片| 成人网在线播放| 精品美女在线播放| 丝袜亚洲另类丝袜在线| 色诱亚洲精品久久久久久| 久久美女艺术照精彩视频福利播放| 日韩av不卡一区二区| 在线观看日韩一区| 亚洲蜜桃精久久久久久久| 国产宾馆实践打屁股91| 精品福利在线导航| 老司机一区二区| 日韩欧美电影在线| 麻豆精品在线观看| 欧美一级午夜免费电影| 天天综合天天综合色| 欧美三区免费完整视频在线观看| 亚洲免费毛片网站| 色婷婷精品大在线视频| 一区二区三区四区视频精品免费| 99精品视频一区二区| 国产日韩亚洲欧美综合| 国产精品资源站在线| 久久免费美女视频| 国产高清成人在线| 成人欧美一区二区三区黑人麻豆| 成人免费av资源| 国产精品毛片久久久久久久| 岛国精品在线观看| 亚洲欧美日韩人成在线播放| 一本色道亚洲精品aⅴ| 一区二区三区不卡视频| 欧美日本免费一区二区三区| 蜜桃在线一区二区三区| 精品国产乱码久久久久久闺蜜| 国产真实乱子伦精品视频| 国产目拍亚洲精品99久久精品| 国产福利电影一区二区三区| 亚洲三级免费观看| 在线一区二区三区做爰视频网站| 亚洲国产婷婷综合在线精品| 欧美福利视频导航| 国内成人精品2018免费看| 国产精品视频看| 在线一区二区三区| 人人狠狠综合久久亚洲| 久久久久99精品一区| 99综合影院在线| 丝袜a∨在线一区二区三区不卡 | 在线这里只有精品| 日韩国产精品久久久久久亚洲| 精品成人私密视频| 一本色道久久综合狠狠躁的推荐| 午夜精品久久一牛影视| 国产亚洲精品aa| 欧美三级电影在线看| 国产精品一区二区在线播放| 亚洲精品成a人| 26uuu亚洲综合色| 91性感美女视频| 免播放器亚洲一区| 亚洲国产精品成人综合色在线婷婷 | 亚洲一区日韩精品中文字幕| 日韩一区二区三区电影| 99久久精品情趣| 捆绑变态av一区二区三区| 亚洲欧洲综合另类| 精品久久国产老人久久综合| 一本色道久久综合精品竹菊| 国产裸体歌舞团一区二区| 亚洲国产cao| 国产精品久久久久久久久果冻传媒| 3d成人动漫网站| 在线视频国产一区| 成人午夜私人影院| 美腿丝袜亚洲一区| 亚洲综合图片区| 国产精品久久久久一区二区三区 | 亚洲国产高清aⅴ视频| 日韩一区二区麻豆国产| 在线免费亚洲电影| 粉嫩av一区二区三区粉嫩| 日本aⅴ亚洲精品中文乱码| 亚洲综合男人的天堂| 中文字幕欧美日本乱码一线二线| 欧美大片拔萝卜| 欧美日韩免费高清一区色橹橹| 北条麻妃一区二区三区| 精品写真视频在线观看| 日韩专区欧美专区| 亚洲成av人综合在线观看| 伊人一区二区三区| 亚洲欧美一区二区三区极速播放 | 天天av天天翘天天综合网色鬼国产| 国产精品国产三级国产有无不卡 | 欧美videossexotv100| 欧美美女激情18p| 欧美日韩成人综合天天影院 | 一区二区三区不卡视频| 天天爽夜夜爽夜夜爽精品视频| 亚洲视频你懂的| 国产精品久久777777| 国产亲近乱来精品视频| 久久久久久麻豆| 国产欧美精品在线观看| 国产日产欧美精品一区二区三区| 久久无码av三级| 欧美高清在线视频| 日韩毛片一二三区| 亚洲伦理在线免费看| 亚洲线精品一区二区三区八戒| 亚洲综合色区另类av| 香蕉乱码成人久久天堂爱免费| 亚洲在线一区二区三区| 五月天婷婷综合| 九九国产精品视频| 国产精品一区二区免费不卡| 成人a免费在线看| 日本韩国视频一区二区| 欧美少妇xxx| 91精品婷婷国产综合久久| 日韩亚洲电影在线| 国产日韩欧美麻豆| 亚洲精选一二三| 日韩精品一二区| 国产一级精品在线| 色琪琪一区二区三区亚洲区| 欧美浪妇xxxx高跟鞋交| 欧美成人女星排行榜| 中文字幕日韩精品一区| 一区二区免费在线| 捆绑调教美女网站视频一区| 成人福利视频网站| 欧美日韩一区二区在线视频| 精品久久久久久综合日本欧美 | 日韩美一区二区三区| 欧美成人在线直播| 国产精品伦理在线| 亚洲国产精品自拍| 国产精品亚洲一区二区三区妖精 | 99久久精品免费看| 欧美一区二区在线播放| 国产精品久久久久久久久免费丝袜 | 风间由美中文字幕在线看视频国产欧美| 国产不卡免费视频| 91麻豆精品国产自产在线| 欧美国产1区2区| 日韩高清在线观看| jizzjizzjizz欧美| 日韩三级在线免费观看| 中文字幕在线一区| 美国三级日本三级久久99| 色综合亚洲欧洲| 久久婷婷国产综合精品青草| 亚洲自拍偷拍麻豆| 成人午夜电影网站| 日韩欧美国产电影| 亚洲午夜精品网| 97se亚洲国产综合自在线观| 91麻豆精品国产91久久久资源速度 | 在线欧美小视频| 国产欧美日本一区视频| 久久精品国产亚洲5555| 欧洲国内综合视频| 国产精品国产三级国产普通话蜜臀| 免费av网站大全久久| 欧美日韩国产综合视频在线观看| 国产精品青草综合久久久久99| 精品亚洲成av人在线观看| 欧美绝品在线观看成人午夜影视| 成人免费一区二区三区视频| 国产一区二三区| 日韩免费高清av| 日韩福利电影在线观看| 欧美亚日韩国产aⅴ精品中极品| 中文字幕在线观看不卡视频| 国产精品一区二区三区四区| 精品国产免费人成电影在线观看四季| 欧美性生活一区| 国产精品私人影院| 久久99久久久久| 欧美一二三区在线| 天天免费综合色| 欧美巨大另类极品videosbest| 亚洲色图色小说| 日本高清成人免费播放| 亚洲青青青在线视频| 91免费观看视频| 一区二区三区中文免费|