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

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

?? qtabbar.cpp

?? qtopia-phone-2.2.0下公共的控件實現(xiàn)源代碼。
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************** $Id: qt/src/widgets/qtabbar.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QTab and QTabBar classes**** 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 "qtabbar.h"#ifndef QT_NO_TABBAR#include "qaccel.h"#include "qbitmap.h"#include "qtoolbutton.h"#include "qapplication.h"#include <ctype.h>#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endif// NOT REVISED/*!  \class QTab qtabbar.h  \brief The structures in a QTabBar.  For custom QTabBar tab headings.  \sa QTabBar*//*! \fn QTab::QTab()  Constructs an empty tab.  All fields are set to empty.*//*! \fn QTab::QTab( const QString& text )  Constructs a tab with a \a text.*//*! \fn QTab::QTab( const QIconSet& icon, const QString& text )  Constructs a tab with an \a icon and a \a text.*//*! Destructs the tab and frees up all allocated resources */QTab::~QTab(){    delete iconset;}/*!  \class QTabBar qtabbar.h  \brief The QTabBar class provides a tab bar, for use in e.g. tabbed  dialogs.  \ingroup advanced  The class is quite simple; it draws the tabs in one of four shapes  and emits a signal when one is selected.  It can be subclassed to  tailor the look and feel.  QTabBar itself support four possible shapes, described in the  QTabBar::Shape documentation.  The choice of tab shape is still a matter of taste, to a large  degree.  Tab dialogs (preferences and the like) invariably use \c  RoundedAbove and nobody uses \c TriangularAbove.  Tab controls in  windows other than dialogs almost always either \c RoundedBelow or  \c TriangularBelow.  Many spreadsheets and other tab controls where  all the pages are essentially similar to use \c TriangularBelow,  while \c RoundedBelow is used mostly when the pages are different  (e.g. a multi-page tool palette).  There is no strong tradition yet,  however, so use your taste and create the tradition.  The most important part of QTabBar's API is the signal selected().  It's emitted whenever the selected page changes (even at startup,  when the selected page changes from 'none').  There are also a slot,  setCurrentTab(), which can be used to select a page  programmatically.  QTabBar creates automatic accelerator keys in the manner of QButton;  e.g. if a tab's label is "\&Graphics" Alt-G becomes an accelerator  key for switching to that tab.  The following virtual functions may need to be reimplemented: <ul>  <li> paint() paints a single tab.  paintEvent() calls paint() for  each tab in such a way that any overlap will look right.  <li>  addTab() creates a new tab and adds it to the bar. <li> selectTab()  decides which, if any, tab the user selects with the mouse. </ul>  <img src=qtabbar-m.png> <img src=qtabbar-w.png>*//*! \enum QTabBar::Shape  This enum type lists the built-in shapes supported by QTabBar:<ul>  <li> \c RoundedAbove - the normal rounded look, above the pages  <li> \c RoundedBelow - the normal rounded look, below the pages  <li> \c TriangularAbove - triangular tabs, above the pages (very  unusual, included for completeness)  <li> \c TriangularBelow - triangular tabs, similar to those used in  e.g. the spreadsheet Excel  </ul>*/struct QTabPrivate {    int id;    int focus;#ifndef QT_NO_ACCEL    QAccel * a;#endif    QTabBar::Shape s;#ifndef QT_NO_TOOLBUTTON    QToolButton* rightB;    QToolButton* leftB;#endif    bool  scrolls;};/*!  \fn void QTabBar::selected( int id )  QTabBar emits this signal whenever any tab is selected, whether by  the program or the user.  The argument \a id is the ID if the tab  as returned by addTab().  show() is guaranteed to emit this signal, so that you can display  your page in a slot connected to this signal.*//*!  Constructs a new, empty tab bar.*/QTabBar::QTabBar( QWidget * parent, const char *name )    : QWidget( parent, name, WRepaintNoErase | WResizeNoErase  ){    d = new QTabPrivate;    d->id = 0;    d->focus = 0;#ifndef QT_NO_ACCEL    d->a = new QAccel( this, "tab accelerators" );#endif    d->s = RoundedAbove;    d->scrolls = FALSE;#ifndef QT_NO_TOOLBUTTON    d->leftB = new QToolButton( LeftArrow, this );    connect( d->leftB, SIGNAL( clicked() ), this, SLOT( scrollTabs() ) );    d->leftB->hide();    d->rightB = new QToolButton( RightArrow, this );    connect( d->rightB, SIGNAL( clicked() ), this, SLOT( scrollTabs() ) );    d->rightB->hide();# ifdef QT_KEYPAD_MODE    if( qt_modalEditingEnabled ) {	d->leftB->setFocusPolicy(NoFocus);	d->rightB->setFocusPolicy(NoFocus);    }# endif#endif    l = new QList<QTab>;    lstatic = new QList<QTab>;    lstatic->setAutoDelete( TRUE );    setFocusPolicy( TabFocus );    setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );#ifndef QT_NO_ACCEL    connect( d->a, SIGNAL(activated(int)), this, SLOT(setCurrentTab(int)) );#endif}/*!  Destroys the tab control, freeing memory used.*/QTabBar::~QTabBar(){    delete d;    d = 0;    delete l;    l = 0;    delete lstatic;    lstatic = 0;}/*!  Adds \a newTab to the tab control.  Allocates a new id, sets \a newTab's id, locates it just to the right of the  existing tabs, inserts an accelerator if the tab's label contains the  string "&p" for some value of p, adds it to the bar, and returns the  newly allocated id.*/int QTabBar::addTab( QTab * newTab ){    return insertTab( newTab );}/*!  Inserts \a newTab to the tab control.  If \a index is not specified, the tab is simply added. Otherwise  it's inserted at the specified position.  Allocates a new id, sets \a newTab's id, locates it respectively,  inserts an accelerator if the tab's label contains the string "&p"  for some value of p, adds it to the bar, and returns the newly  allocated id.*/int QTabBar::insertTab( QTab * newTab, int index ){    newTab->id = d->id++;    l->insert( 0, newTab );    if ( index < 0 || index > int(lstatic->count()) )	lstatic->append( newTab );    else	lstatic->insert( index, newTab );    layoutTabs();    updateArrowButtons();    makeVisible( tab( currentTab() ) );#ifndef QT_NO_ACCEL    int p = QAccel::shortcutKey( newTab->label );    if ( p )	d->a->insertItem( p, newTab->id );#endif    return newTab->id;}/*!  Removes tab \a t from the tab control.*/void QTabBar::removeTab( QTab * t ){    //#### accelerator labels??    l->remove( t );    lstatic->remove( t );    layoutTabs();    updateArrowButtons();    makeVisible( tab( currentTab() ) );    update();}/*!  Enable tab \a id if \a enable is TRUE, or disable it if \a enable is  FALSE.  If \a id is currently selected, setTabEnabled() makes  another tab selected.  setTabEnabled() updates the display respectively if this causes a  change in \a id's status.  \sa update(), isTabEnabled()*/void QTabBar::setTabEnabled( int id, bool enabled ){    QTab * t;    for( t = l->first(); t; t = l->next() ) {	if ( t && t->id == id ) {	    if ( t->enabled != enabled ) {		t->enabled = enabled;#ifndef QT_NO_ACCEL		d->a->setItemEnabled( t->id, enabled );#endif		QRect r( t->r );		if ( !enabled && id == currentTab() ) {		    QPoint p1( t->r.center() ), p2;		    int m = 2147483647;		    int distance;		    // look for the closest enabled tab - measure the		    // distance between the centers of the two tabs		    for( QTab * n = l->first(); n; n = l->next() ) {			if ( n->enabled ) {			    p2 = n->r.center();			    distance = (p2.x() - p1.x())*(p2.x() - p1.x()) +				       (p2.y() - p1.y())*(p2.y() - p1.y());			    if ( distance < m ) {				t = n;				m = distance;			    }			}		    }		    if ( t->enabled ) {			r = r.unite( t->r );			l->append( l->take( l->findRef( t ) ) );			emit selected( t->id );		    }		}		updateMask();		repaint( r );	    }	    return;	}    }}/*!  Returns TRUE if the tab with id \a id is enabled, or FALSE if it  is disabled or there is no such tab.  \sa setTabEnabled()*/bool QTabBar::isTabEnabled( int id ) const{    QTab * t;    for( t = l->first(); t; t = l->next() ) {	if ( t && t->id == id )	    return t->enabled;    }    return FALSE;}/*!\reimp*/QSize QTabBar::sizeHint() const{    QTab * t = l->first();    if ( t ) {	QRect r( t->r );	while ( (t = l->next()) != 0 )	    r = r.unite( t->r );	return r.size().expandedTo( QApplication::globalStrut() );    } else {	return QSize( 0, 0 ).expandedTo( QApplication::globalStrut() );    }}/*! \reimp */QSize QTabBar::minimumSizeHint() const{    return QSize(#ifndef QT_NO_TOOLBUTTON	d->rightB->sizeHint().width() * 2 +#endif	75, sizeHint().height() );}/*!\reimp*/QSizePolicy QTabBar::sizePolicy() const{    //### removeme 3.0    return QWidget::sizePolicy();}/*!  Paint the single tab \a t using \a p.  If and only if \a selected  is TRUE, \a t is currently selected.  This virtual function may be reimplemented to change the look of  QTabBar.  If you decide to reimplement it, you may also need to  reimplement sizeHint().*/void QTabBar::paint( QPainter * p, QTab * t, bool selected ) const{    style().drawTab( p, this, t, selected );    QRect r( t->r );    p->setFont( font() );    int iw = 0;    int ih = 0;    if ( t->iconset != 0 ) {	iw = t->iconset->pixmap( QIconSet::Small, QIconSet::Normal ).width();	ih = t->iconset->pixmap( QIconSet::Small, QIconSet::Normal ).height();	if (!t->label.isEmpty())	   iw +=2;     }    int w = iw + p->fontMetrics().width( t->label ) + 4 + style().pixelMetric(QStyle::TabHMargin);    int h = QMAX(p->fontMetrics().height() + 4, ih );    paintLabel( p, QRect( r.left() + (r.width()-w)/2,			  r.top() + (r.height()-h)/2,			  w, h ), t, t->id == keyboardFocusTab() );}/*!  Paints the label of tab \a t centered in rectangle \a br using  painter \a p and draws a focus indication if \a has_focus is TRUE.*/void QTabBar::paintLabel( QPainter* p, const QRect& br,			  QTab* t, bool has_focus ) const{    QRect r = br;    if ( t->iconset) {	// the tab has an iconset, draw it in the right mode	QIconSet::Mode mode = (t->enabled && isEnabled())	    ? QIconSet::Normal : QIconSet::Disabled;	if ( mode == QIconSet::Normal && has_focus )	    mode = QIconSet::Active;	QPixmap pixmap = t->iconset->pixmap( QIconSet::Small, mode );	int pixw = pixmap.width();	int pixh = pixmap.height();	r.setLeft( r.left() + pixw + 2 );	p->drawPixmap( br.left()+2, br.center().y()-pixh/2, pixmap );    }    QRect tr = r;    if ( t->id == currentTab() ) 	tr.setBottom( tr.bottom() - style().defaultFrameWidth() );        if ( t->enabled && isEnabled()  ) {#if defined(_WS_WIN32_)	if ( colorGroup().brush( QColorGroup::Button ) == colorGroup().brush( QColorGroup::Background ) )	    p->setPen( colorGroup().buttonText() );	else	    p->setPen( colorGroup().foreground() );#else	p->setPen( colorGroup().foreground() );#endif	p->drawText( tr, AlignCenter | ShowPrefix, t->label );    } else if ( style() == MotifStyle ) {	p->setPen( palette().disabled().foreground() );	p->drawText( tr, AlignCenter | ShowPrefix, t->label );    } else { // Windows style, disabled	p->setPen( colorGroup().light() );	QRect wr = tr;	wr.moveBy( 1, 1 );	p->drawText( wr, AlignCenter | ShowPrefix, t->label );	p->setPen( palette().disabled().foreground() );	p->drawText( tr, AlignCenter | ShowPrefix, t->label );    }    if ( !has_focus )	return;    if ( style() == WindowsStyle )#ifdef QT_KEYPAD_MODE	if( qt_modalEditingEnabled ) {	    style().drawFocusRect(p, br, colorGroup(), &colorGroup().highlight());	}#else	p->drawWinFocusRect( br, backgroundColor() );#endif    else // shouldn't this be black, irrespective of everything?	p->drawRect( br );}/*!  Draws the mask for this tab bar.  \internal  This is not totally right - a few corner pixels missing.*/void  QTabBar::updateMask(){    if ( !autoMask() )	return;    QBitmap bm( size() );    bm.fill( color0 );    QPainter p;    p.begin( &bm, this );    p.setBrush(color1);    p.setPen(color1);    QTab * t;    t = l->first();    do {	QTab * n = l->next();	if ( t )	    style().drawTabMask( &p, this, t, n == 0 );	t = n;    } while ( t != 0 );    p.end();    setMask( bm );}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品福利一区二区三区| 午夜久久久影院| 国产网站一区二区| 欧美岛国在线观看| 日韩欧美一区二区免费| 欧美日本一道本| 欧美日韩国产经典色站一区二区三区| 99精品在线观看视频| 粉嫩欧美一区二区三区高清影视| 国产麻豆成人精品| 国产尤物一区二区| 国产精品一二二区| 高清成人在线观看| 暴力调教一区二区三区| 不卡大黄网站免费看| caoporm超碰国产精品| 91免费版pro下载短视频| 91首页免费视频| 色欲综合视频天天天| 欧美性三三影院| 欧美日韩aaaaaa| 欧美一级生活片| 久久日一线二线三线suv| 久久久高清一区二区三区| 久久精品噜噜噜成人88aⅴ| 国产精品女人毛片| 亚洲欧美视频在线观看| 一区二区三区中文在线观看| 亚洲国产一二三| 日韩av高清在线观看| 精品亚洲aⅴ乱码一区二区三区| 国产一区二区三区在线观看免费| 懂色av一区二区夜夜嗨| 91美女片黄在线观看91美女| 欧美亚洲免费在线一区| 日韩视频123| 国产欧美精品一区| 一区二区三区四区在线播放 | 日韩国产精品久久久久久亚洲| 日韩福利电影在线观看| 国产在线播放一区二区三区| 成人激情黄色小说| 欧美日韩情趣电影| 欧美成va人片在线观看| 中文字幕在线免费不卡| 婷婷丁香久久五月婷婷| 国产乱码一区二区三区| 色婷婷久久综合| 日韩精品一区在线观看| 国产精品夫妻自拍| 婷婷久久综合九色综合绿巨人| 国内成人免费视频| 在线免费观看日韩欧美| 亚洲精品在线免费播放| 亚洲免费在线视频一区 二区| 日韩电影在线一区二区三区| 成人ar影院免费观看视频| 欧美日韩另类一区| 欧美国产日本韩| 三级精品在线观看| 99精品欧美一区二区三区综合在线| 欧美人伦禁忌dvd放荡欲情| 欧美国产国产综合| 热久久国产精品| 99久久伊人网影院| 欧美xingq一区二区| 亚洲精品视频一区二区| 国产精品一二三区| 欧美精品久久99久久在免费线 | 久久99精品久久久久久动态图| 99久久99久久精品免费看蜜桃| 日韩一二三区视频| 亚洲女人的天堂| 国产精品一区二区91| 欧美高清视频在线高清观看mv色露露十八 | 成人激情开心网| 欧美www视频| 丝袜a∨在线一区二区三区不卡 | 久久久亚洲午夜电影| 五月婷婷综合在线| 色999日韩国产欧美一区二区| 久久久99久久| 激情综合色播五月| 在线综合+亚洲+欧美中文字幕| 亚洲视频你懂的| 国产91精品入口| 久久天天做天天爱综合色| 美女一区二区在线观看| 欧美色区777第一页| 最新热久久免费视频| 国产黄色91视频| 精品国产伦一区二区三区免费| 亚洲成av人片在线观看| 91浏览器入口在线观看| 欧美国产日韩精品免费观看| 国产精品一卡二卡在线观看| 欧美成人精品二区三区99精品| 日韩国产在线一| 精品婷婷伊人一区三区三| 一区二区在线看| 一本到高清视频免费精品| 亚洲女同女同女同女同女同69| 波多野结衣中文一区| 亚洲国产精品ⅴa在线观看| 国产精品一二三在| 国产女人18水真多18精品一级做| 精品一二三四区| 久久这里只有精品视频网| 国内精品伊人久久久久av一坑| 欧美一二三区在线| 蜜桃av一区二区| 精品伦理精品一区| 精品亚洲porn| 国产午夜久久久久| 成人午夜视频网站| 国产精品久久久久婷婷| 成人a免费在线看| 中文字幕一区在线观看视频| 北条麻妃一区二区三区| 亚洲精品乱码久久久久| 欧美影院一区二区三区| 午夜精品一区二区三区三上悠亚| 欧美性猛交一区二区三区精品| 亚洲成人综合网站| 91精品国产综合久久精品性色| 日本不卡高清视频| 精品国产乱码久久久久久浪潮 | 老色鬼精品视频在线观看播放| 日韩精品综合一本久道在线视频| 久久国产免费看| 国产欧美日韩在线视频| 不卡的av中国片| 亚洲国产日韩a在线播放性色| 91麻豆精品国产91久久久使用方法| 免费一级欧美片在线观看| 久久久久国产精品厨房| 波多野结衣亚洲| 午夜在线电影亚洲一区| 日韩一级高清毛片| 国产福利精品导航| 最新国产精品久久精品| 欧美日本国产视频| 国产精品一区二区果冻传媒| 一区二区在线看| 日韩一区二区三区精品视频| 国产精品亚洲一区二区三区在线| 1024成人网色www| 欧美一区二区福利在线| 国产九色精品成人porny| 亚洲视频每日更新| 欧美一级夜夜爽| 不卡的av网站| 日本欧美加勒比视频| 欧美α欧美αv大片| 9色porny自拍视频一区二区| 日韩在线a电影| 国产日韩成人精品| 欧美亚洲国产一区二区三区va| 麻豆久久久久久久| 亚洲日穴在线视频| 亚洲精品在线网站| 欧美日韩久久久久久| 国产91精品精华液一区二区三区| 亚洲自拍另类综合| 国产欧美一区二区三区网站| 欧美日韩一区二区三区在线看| 国产成人综合网| 视频一区二区三区在线| 国产精品入口麻豆九色| 日韩一区二区免费在线观看| 99精品欧美一区| 国模大尺度一区二区三区| 亚洲宅男天堂在线观看无病毒| 久久综合久久综合久久| 欧美亚洲图片小说| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日韩一级免费观看| 色婷婷精品大视频在线蜜桃视频 | 波多野结衣在线一区| 精品一区二区三区在线观看 | 91一区在线观看| 国产成人av电影在线播放| 日本不卡在线视频| 亚洲精品国产第一综合99久久 | 久久久久综合网| 欧美一区二区三区免费| 色吊一区二区三区| 成人禁用看黄a在线| 极品尤物av久久免费看| 视频一区在线播放| 亚洲一区二区三区三| 中文字幕亚洲一区二区av在线 | 久久先锋影音av鲁色资源网| 欧美日韩国产小视频| 欧美影视一区在线| 色婷婷综合视频在线观看| 成人app软件下载大全免费| 九九**精品视频免费播放| 天天亚洲美女在线视频| 亚洲国产欧美一区二区三区丁香婷|