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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? qsplitter.cpp

?? qtopia-phone-2.2.0下公共的控件實(shí)現(xiàn)源代碼。
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/****************************************************************************** $Id: qt/src/widgets/qsplitter.cpp   2.3.12   edited 2005-10-27 $****  Splitter widget****  Created:  980105**** 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 "qsplitter.h"#ifndef QT_NO_SPLITTER#include "qpainter.h"#include "qdrawutil.h"#include "qbitmap.h"#include "../kernel/qlayoutengine_p.h"#include "qlist.h"#include "qarray.h"#include "qobjectlist.h"#include "qapplication.h" //sendPostedEventsclass QSplitterHandle : public QWidget{public:    QSplitterHandle( Qt::Orientation o,		       QSplitter *parent, const char* name=0 );    void setOrientation( Qt::Orientation o );    Qt::Orientation orientation() const { return orient; }    bool opaque() const { return s->opaqueResize(); }    QSize sizeHint() const;    QSizePolicy sizePolicy() const;    int id() const { return myId; } // data->list.at(id())->wid == this    void setId( int i ) { myId = i; }protected:    void paintEvent( QPaintEvent * );    void mouseMoveEvent( QMouseEvent * );    void mousePressEvent( QMouseEvent * );    void mouseReleaseEvent( QMouseEvent * );private:    Qt::Orientation orient;    bool opaq;    int myId;    QSplitter *s;};static int mouseOffset;static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit riskyQSplitterHandle::QSplitterHandle( Qt::Orientation o,				  QSplitter *parent, const char * name )    : QWidget( parent, name ){    s = parent;    setOrientation(o);}QSizePolicy QSplitterHandle::sizePolicy() const{    //### removeme 3.0    return QWidget::sizePolicy();}QSize QSplitterHandle::sizeHint() const{    int sw = style().splitterWidth();    return QSize(sw,sw).expandedTo( QApplication::globalStrut() );}void QSplitterHandle::setOrientation( Qt::Orientation o ){    orient = o;#ifndef QT_NO_CURSOR    if ( o == QSplitter::Horizontal )	setCursor( splitHCursor );    else	setCursor( splitVCursor );#endif}void QSplitterHandle::mouseMoveEvent( QMouseEvent *e ){    if ( !(e->state()&LeftButton) )	return;    QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))		 - mouseOffset;    if ( opaque() ) {	s->moveSplitter( pos, id() );    } else {	int min = pos; int max = pos;	s->getRange( id(), &min, &max );	s->setRubberband( QMAX( min, QMIN(max, pos )));    }}void QSplitterHandle::mousePressEvent( QMouseEvent *e ){    if ( e->button() == LeftButton )	mouseOffset = s->pick(e->pos());}void QSplitterHandle::mouseReleaseEvent( QMouseEvent *e ){    if ( !opaque() && e->button() == LeftButton ) {	QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()));	s->setRubberband( -1 );	s->moveSplitter( pos, id() );    }}void QSplitterHandle::paintEvent( QPaintEvent * ){    QPainter p( this );    s->drawSplitter( &p, 0, 0, width(), height() );}class QSplitterLayoutStruct{public:    QSplitter::ResizeMode mode;    QCOORD sizer;    bool isSplitter;    QWidget *wid;};class QSplitterData{public:    QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {}    QList<QSplitterLayoutStruct> list;    bool opaque;    bool firstShow;};// NOT REVISED/*!  \class QSplitter qsplitter.h  \brief The QSplitter class implements a splitter widget.  \ingroup organizers  A splitter lets the user control the size of child widgets by  dragging the boundary between the children. Any number of widgets  may be controlled.  To show a QListBox, a QListView and a QMultiLineEdit side by side:  \code    QSplitter *split = new QSplitter( parent );    QListBox *lb = new QListBox( split );    QListView *lv = new QListView( split );    QMultiLineEdit *ed = new QMultiLineEdit( split );  \endcode  In QSplitter the boundary can be either horizontal or vertical.  The  default is horizontal (the children are side by side) and you  can use setOrientation( QSplitter::Vertical ) to set it to vertical.  By default, all widgets can be as large or as small as the user  wishes, down to \link QWidget::minimumSizeHint() minimumSizeHint()\endlink.  You can naturally use setMinimumSize() and/or  setMaximumSize() on the children. Use setResizeMode() to specify that  a widget should keep its size when the splitter is resized.  QSplitter normally resizes the children only at the end of a  resize operation, but if you call setOpaqueResize( TRUE ), the  widgets are resized as often as possible.  The initial distribution of size between the widgets is determined  by the initial size of each widget. You can also use setSizes() to  set the sizes of all the widgets. The function sizes() returns the  sizes set by the user.  If you hide() a child, its space will be distributed among the other  children. When you show() it again, it will be reinstated.  <img src=qsplitter-m.png> <img src=qsplitter-w.png>  \sa QTabBar*/static QSize minSize( const QWidget *w ){    QSize min = w->minimumSize();    QSize s;    if ( min.height() <= 0 || min.width() <= 0 )	s = w->minimumSizeHint();    if ( min.height() > 0 )	s.setHeight( min.height() );    if ( min.width() > 0 )	s.setWidth( min.width() );    return s.expandedTo(QSize(0,0));}/*!  Constructs a horizontal splitter.*/QSplitter::QSplitter( QWidget *parent, const char *name )    :QFrame(parent,name,WPaintUnclipped){     orient = Horizontal;     init();}/*!  Constructs splitter with orientation \a o.*/QSplitter::QSplitter( Orientation o, QWidget *parent, const char *name )    :QFrame(parent,name,WPaintUnclipped){     orient = o;     init();}/*!  Destructs the splitter.*/QSplitter::~QSplitter(){    data->list.setAutoDelete( TRUE );    delete data;}void QSplitter::init(){    data = new QSplitterData;    if ( orient == Horizontal )	setSizePolicy( QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Minimum) );    else    	setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed) );}/*!  \fn void QSplitter::refresh()  Updates the splitter state. You should not need to call this  function during normal use of the splitter.*//*!  Sets the orientation to \a o.  By default the orientation is  horizontal (the widgets are side by side).  \sa orientation()*/void QSplitter::setOrientation( Orientation o ){    if ( orient == o )	return;    orient = o;    if ( orient == Horizontal )	setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ) );    else    	setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );    QSplitterLayoutStruct *s = data->list.first();    while ( s ) {	if ( s->isSplitter )	    ((QSplitterHandle*)s->wid)->setOrientation( o );	s = data->list.next();  // ### next at end of loop, no iterator    }    recalc( isVisible() );}/*!   \fn Orientation QSplitter::orientation() const   Returns the orientation (\c Horizontal or \c Vertical) of the splitter.   \sa setOrientation()*//*!  \reimp*/void QSplitter::resizeEvent( QResizeEvent * ){    doResize();}/*!  Inserts the widget \a w at the end, or at the beginning if \a first is TRUE  It is the responsibility of the caller of this function to make sure  that \a w is not already in the splitter, and to call recalcId if  needed.  (If \a first is TRUE, then recalcId is very probably  needed.)*/QSplitterLayoutStruct *QSplitter::addWidget( QWidget *w, bool first ){    QSplitterLayoutStruct *s;    QSplitterHandle *newHandle = 0;    if ( data->list.count() > 0 ) {	s = new QSplitterLayoutStruct;	s->mode = KeepSize;	newHandle = new QSplitterHandle( orientation(), this );	s->wid = newHandle;	newHandle->setId(data->list.count());	s->isSplitter = TRUE;	s->sizer = pick( newHandle->sizeHint() );	if ( first )	    data->list.insert( 0, s );	else	    data->list.append( s );    }    s = new QSplitterLayoutStruct;    s->mode = Stretch;    s->wid = w;    if ( !testWState( WState_Resized ) && w->sizeHint().isValid() )	s->sizer = pick( w->sizeHint() );    else	s->sizer = pick( w->size() );    s->isSplitter = FALSE;    if ( first )	data->list.insert( 0, s );    else	data->list.append( s );    if ( newHandle && isVisible() )	newHandle->show(); //will trigger sending of post events    return s;}/*!  Tells the splitter that a child widget has been inserted/removed.*/void QSplitter::childEvent( QChildEvent *c ){    if ( c->type() == QEvent::ChildInserted ) {	if ( !c->child()->isWidgetType() )	    return;	if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) )	    return;	QSplitterLayoutStruct *s = data->list.first();	while ( s ) {	    if ( s->wid == c->child() )		return;	    s = data->list.next();	}	addWidget( (QWidget*)c->child() );	recalc( isVisible() );    } else if ( c->type() == QEvent::ChildRemoved ) {	QSplitterLayoutStruct *p = 0;	if ( data->list.count() > 1 )	    p = data->list.at(1); //remove handle _after_ first widget.	QSplitterLayoutStruct *s = data->list.first();	while ( s ) {	    if ( s->wid == c->child() ) {		data->list.removeRef( s );		delete s;		if ( p && p->isSplitter ) {		    data->list.removeRef( p );		    delete p->wid; //will call childEvent		    delete p;		}		recalcId();		doResize();		return;	    }	    p = s;	    s = data->list.next();	}    }}/*!  Shows a rubber band at position \a p. If \a p is negative, the  rubber band is removed.*/void QSplitter::setRubberband( int p ){    QPainter paint( this );    paint.setPen( gray );    paint.setBrush( gray );    paint.setRasterOp( XorROP );    QRect r = contentsRect();    const int rBord = 3; //Themable????    const int sw = style().splitterWidth();    if ( orient == Horizontal ) {	if ( opaqueOldPos >= 0 )	    paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(),			    2*rBord, r.height() );	if ( p >= 0 )	    paint.drawRect( p  + sw/2 - rBord, r.y(), 2*rBord, r.height() );    } else {	if ( opaqueOldPos >= 0 )	    paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord,			    r.width(), 2*rBord );	if ( p >= 0 )	    paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord );    }    opaqueOldPos = p;}/*! \reimp */bool QSplitter::event( QEvent *e ){    if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) {	recalc( isVisible() );	if ( e->type() == QEvent::Show )	    data->firstShow = FALSE;    }    return QWidget::event( e );}/*!  Draws the splitter handle in the rectangle described by \a x, \a y,  \a w, \a h using painter \a p.  \sa QStyle::drawSplitter*/void QSplitter::drawSplitter( QPainter *p,			      QCOORD x, QCOORD y, QCOORD w, QCOORD h ){    style().drawSplitter( p, x, y, w, h, colorGroup(), orient );}/*!  Returns the id of the splitter to the right of or below the widget \a w,  or 0 if there is no such splitter.  (ie. it is either not in this QSplitter, or it is at the end).*/int QSplitter::idAfter( QWidget* w ) const{    QSplitterLayoutStruct *s = data->list.first();    bool seen_w = FALSE;    while ( s ) {	if ( s->isSplitter && seen_w )	    return data->list.at();	if ( !s->isSplitter && s->wid == w )	    seen_w = TRUE;	s = data->list.next();    }    return 0;}/*!  Moves the left/top edge of the splitter handle with id \a id as  close as possible to \a p which is the distance from the left (or  top) edge of the widget.  \sa idAfter()*/void QSplitter::moveSplitter( QCOORD p, int id ){    p = adjustPos( p, id );    QSplitterLayoutStruct *s = data->list.at(id);    int oldP = orient == Horizontal? s->wid->x() : s->wid->y();    bool upLeft = p < oldP;    moveAfter( p, id, upLeft );    moveBefore( p-1, id-1, upLeft );    storeSizes();}void QSplitter::setG( QWidget *w, int p, int s ){    if ( orient == Horizontal )	w->setGeometry( p, contentsRect().y(), s, contentsRect().height() );    else	w->setGeometry( contentsRect().x(), p, contentsRect().width(), s );}/*!  Places the right/bottom edge of the widget at \a id at position \a pos.  \sa idAfter()*/void QSplitter::moveBefore( int pos, int id, bool upLeft ){    QSplitterLayoutStruct *s = data->list.at(id);    if ( !s )	return;    QWidget *w = s->wid;    if ( w->isHidden() ) {	moveBefore( pos, id-1, upLeft );    } else if ( s->isSplitter ) {	int dd = s->sizer;	if ( upLeft ) {	    setG( w, pos-dd+1, dd );	    moveBefore( pos-dd, id-1, upLeft );	} else {	    moveBefore( pos-dd, id-1, upLeft );	    setG( w, pos-dd+1, dd );	}    } else {	int left = pick( w->pos() );	int dd = pos - left + 1;	dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize())));	int newLeft = pos-dd+1;	setG( w, newLeft, dd );	if ( left != newLeft )	    moveBefore( newLeft-1, id-1, upLeft );    }}/*!  Places the left/top edge of the widget at \a id at position \a pos.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品免费看| 91香蕉视频黄| 日韩一区二区三区免费看 | 久久99最新地址| 欧美伦理视频网站| 久久精品噜噜噜成人88aⅴ| 日韩欧美在线综合网| 国产一区二区影院| 国产亚洲欧美日韩日本| 成人爱爱电影网址| 亚洲午夜羞羞片| 精品国产不卡一区二区三区| 成人一道本在线| 亚洲欧美国产77777| 欧美日本在线看| 蜜臀av性久久久久蜜臀av麻豆| xvideos.蜜桃一区二区| 成人激情小说网站| 午夜视频一区二区三区| 精品精品国产高清一毛片一天堂| 粉嫩蜜臀av国产精品网站| 亚洲视频一区二区在线观看| 欧美日韩国产精品自在自线| 精品一区二区在线播放| 亚洲色图在线看| 欧美一区二区三级| 成人黄色免费短视频| 亚洲午夜三级在线| 精品卡一卡二卡三卡四在线| gogo大胆日本视频一区| 亚洲成人中文在线| 久久久久88色偷偷免费| 欧美性大战xxxxx久久久| 国产一区999| 亚洲影视在线播放| 久久精品网站免费观看| 欧美专区亚洲专区| 国产精品一区二区免费不卡| 亚洲五码中文字幕| 国产亚洲精品免费| 欧美日韩精品一二三区| 国产一区二区三区久久悠悠色av| 亚洲三级在线播放| 久久久久久久综合色一本| 欧美午夜视频网站| 国产精品1区二区.| 日韩av中文字幕一区二区三区| 中文字幕欧美激情| 日韩欧美一二三| 欧美日韩精品三区| 91女人视频在线观看| 国产伦精一区二区三区| 日韩av一区二区三区| 亚洲国产精品久久久男人的天堂 | 日韩**一区毛片| 1024国产精品| 久久久无码精品亚洲日韩按摩| 日韩欧美亚洲国产另类 | 欧美欧美欧美欧美| 99re这里都是精品| 成人午夜在线播放| 国产精品中文字幕欧美| 五月综合激情婷婷六月色窝| 中文字幕在线不卡一区二区三区| 日韩一卡二卡三卡四卡| 午夜免费欧美电影| 亚洲六月丁香色婷婷综合久久 | 最新日韩av在线| 久久精品这里都是精品| 亚洲精品一区二区三区福利 | 国产精品久久久久久久浪潮网站| 欧美日本乱大交xxxxx| www.av精品| 国产精一品亚洲二区在线视频| 香蕉成人啪国产精品视频综合网| 国产精品另类一区| 中文字幕精品三区| 久久久精品免费免费| 久久女同性恋中文字幕| 精品女同一区二区| 91精品国产高清一区二区三区 | 国产精品丝袜在线| 欧美激情在线一区二区三区| 国产欧美日韩亚州综合| 久久亚洲一级片| 国产精品视频一二三区| 亚洲欧美日本韩国| 亚洲mv在线观看| 日本一不卡视频| 日本vs亚洲vs韩国一区三区二区| 一区二区三区精品视频在线| 亚洲天堂a在线| 亚洲午夜久久久久久久久电影院 | 51久久夜色精品国产麻豆| 欧美一级高清片| 91成人网在线| 欧美午夜精品理论片a级按摩| 91美女蜜桃在线| 欧美亚洲丝袜传媒另类| 日韩欧美在线1卡| 亚洲国产高清在线| 亚洲午夜精品网| 久久99国产乱子伦精品免费| 国产精品69毛片高清亚洲| 一本色道a无线码一区v| 91精品免费观看| 欧美极品xxx| 日韩制服丝袜先锋影音| 精久久久久久久久久久| 国产成人精品一区二区三区四区| gogogo免费视频观看亚洲一| 欧美亚洲动漫精品| 久久人人超碰精品| 一级中文字幕一区二区| 日韩**一区毛片| 成人美女视频在线观看| 欧美日韩午夜在线视频| 久久久夜色精品亚洲| 亚洲欧美色一区| 久久成人av少妇免费| 91论坛在线播放| 久久蜜臀精品av| 午夜精品久久久久久久久久久| 国产高清精品久久久久| 在线国产亚洲欧美| 国产亚洲制服色| 亚洲香肠在线观看| 国产成人av电影在线| 欧美一区三区四区| 中文字幕亚洲在| 久久精品国产网站| 色欧美片视频在线观看| 日韩欧美国产一区二区三区 | 亚洲一区二区在线视频| 国产曰批免费观看久久久| 色就色 综合激情| 国产亚洲欧美色| 免费观看日韩av| 色婷婷久久一区二区三区麻豆| 久久久精品综合| 九九国产精品视频| 色94色欧美sute亚洲线路二| 久久综合九色欧美综合狠狠| 亚洲国产综合色| 色婷婷综合久久| 国产精品麻豆一区二区 | 日本亚洲电影天堂| 欧美影院一区二区| 亚洲欧美视频一区| 成人高清伦理免费影院在线观看| 日韩欧美激情在线| 日韩成人一级片| 337p亚洲精品色噜噜噜| 亚洲高清一区二区三区| 91在线国产福利| 中文字幕一区二区三区在线观看| 国产成人自拍在线| 久久久久久影视| 国产成人啪免费观看软件| 久久久综合精品| 国产精品99久久久久久宅男| 久久―日本道色综合久久 | 成人激情小说网站| 国产欧美精品国产国产专区| 久久精品国产亚洲a| 欧美一区二区高清| 美女视频第一区二区三区免费观看网站 | 日本一区二区在线不卡| 激情小说欧美图片| 久久久久久久久蜜桃| 国产a视频精品免费观看| wwwwxxxxx欧美| 成人免费观看视频| 中文字幕一区二区三区不卡| 国产精品久久久久永久免费观看 | 精品国产91乱码一区二区三区 | youjizz久久| 一区二区视频在线看| 日韩精品中文字幕一区| 色欧美日韩亚洲| 成人综合激情网| 天天射综合影视| 国产一区在线观看视频| 久久久久久久久久久久电影| 国产精一品亚洲二区在线视频| 久久精品一区二区三区不卡 | 91精品在线麻豆| 狠狠色丁香婷综合久久| 久久精品亚洲精品国产欧美| 成人激情文学综合网| 亚洲欧美一区二区三区孕妇| 精品污污网站免费看| 久久精品国产99| 中文字幕日韩精品一区| 欧美性生活大片视频| 精品一区二区三区视频| 国产精品人成在线观看免费| 欧美日韩在线播放三区| 精品亚洲aⅴ乱码一区二区三区| 国产精品每日更新在线播放网址 |