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

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

?? qcombobox.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/************************************************************************ $Id: qt/src/widgets/qcombobox.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QComboBox widget class**** Created : 940426**** 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 "qcombobox.h"#ifndef QT_NO_COMBOBOX#include "qpopupmenu.h"#include "qlistbox.h"#include "qpainter.h"#include "qdrawutil.h"#include "qstrlist.h"#include "qpixmap.h"#include "qtimer.h"#include "qapplication.h"#include "qlineedit.h"#include "qbitmap.h"#include "qeffects_p.h"#include <limits.h>#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endif#ifndef _WS_QWS_#define Q_WS_REPLAYSONPOPDOWN#endif// NOT REVISED/*!  \class QComboBox qcombobox.h  \brief The QComboBox widget is a combined button and popup list.  \ingroup basic  A combo box may be defined as a selection widget which displays the  current selection, and which can pop up a list of possible  selections.  Some combo boxes also allow the user to select  arbitrary strings, using a line editor.  Since combo boxes occupy little screen space and always display the  current selection, they are very well suited to displaying and  selecting modes (such as font family and size): The user can always  see what mode he/she is in, and the majority of the screen space is  available for real work.  QComboBox supports three different appearances: Motif 1.x, Motif 2.0  and Windows 95.  In Motif 1.x, a combo box was called XmOptionMenu.  In Motif 2.0, OSF introduced an improved combo box and  named that XmComboBox.  QComboBox provides both.  QComboBox provides two different constructors.  The simplest one  creates an old-style combo box in Motif style:  \code      QComboBox * c = new QComboBox( this, "read-only combo" );  \endcode  The other one creates a new-style combo box in Motif style, and can  create both read-only and read-write combo boxes:  \code      QComboBox * c1 = new QComboBox( FALSE, this, "read-only combo" );      QComboBox * c2 = new QComboBox( TRUE, this, "read-write combo" );  \endcode  New-style combo boxes use a list box in both Motif and Windows  styles, and both the content size and the on-screen size of the list  box can be limited.  Old-style combo boxes use a popup in Motif  style, and that popup will happily grow larger than the desktop if  you put enough data in it.  The two constructors create identical-looking combos in Windows  style.  Combo boxes can contain pixmaps as well as texts; the  insert() and changeItem() functions are suitably overloaded.  For  read-write combo boxes, the function clearEdit()  is provided, to clear the displayed string without changing the  combo box' contents.  A combo box emits two signals, activated() and highlighted(), when a  new item has been activated (selected) or highlighted (set to  current).  Both signals exist in two versions, one with a \c char*  argument and one with an \c int argument.  If the user highlights or  activates a pixmap, only the \c int signals are emitted.  When the user enters a new string in a read-write combo, the widget  may or may not insert it, and it can insert it in several locations.  The default policy is is \c AtBottom, you can change it using  setInsertionPolicy().  It is possible to constrain the input to an editable combo box using  QValidator; see setValidator().  By default, all input is accepted.  If the combo box is not editable then it has a default focusPolicy()  of \c TabFocus, i.e. it will not grab focus if clicked.  This  differs from both Windows and Motif.  If the combo box is editable then it  has a default focusPolicy() of \c StrongFocus, i.e. it will grab focus if  clicked.  <img src="qcombo1-m.png">(Motif 1, read-only)<br clear=all>  <img src="qcombo2-m.png">(Motif 2, read-write)<br clear=all>  <img src="qcombo3-m.png">(Motif 2, read-only)<br clear=all>  <img src="qcombo1-w.png">(Windows style)  \sa QLineEdit QListBox QSpinBox QRadioButton QButtonGroup  <a href="guibooks.html#fowler">GUI Design Handbook: Combo Box,</a>  <a href="guibooks.html#fowler">GUI Design Handbook: Drop-Down List Box.</a>*//*! \enum QComboBox::Policy  This enum type specifies what QComboBox should do with a new string  entered by the user.  The following policies are defined: <ul>  <li> \c NoInsertion means not to insert the string in the combo.  <li> \c AtTop means to insert the string at the top of the combo box.  <li> \c AtCurrent means to replace the previously selected item with  the typed string.  <li> \c AtBottom means to insert the string at the bottom of the  combo box.  <li> \c AfterCurrent means to to insert the string just after the  previously selected item.  <li> \c BeforeCurrent means to to insert the string just before the  previously selected item.  </ul>  activated() is always emitted, of course.  If inserting the new string would cause the combo box to breach  its content size limit, the item at the other end of the list is  deleted.  The definition of "other end" is implementation-dependent.*//*! \fn void QComboBox::activated( int index )  This signal is emitted when a new item has been activated (selected).  The \e index is the position of the item in the popup list.*//*! \fn void QComboBox::activated( const QString &string )  This signal is emitted when a new item has been activated  (selected). \a string is the activated string.  You can also use activated(int) signal, but be aware that its  argument is meaningful only for selected strings, not for typed  strings.*//*! \fn void QComboBox::highlighted( int index )  This signal is emitted when a new item has been set to current.  The \e index is the position of the item in the popup list.*//*! \fn void QComboBox::highlighted( const QString &string )  This signal is emitted when a new item has been highlighted. \a  string is the highlighted string.  You can also use highlighted(int) signal.*//*! \fn void QComboBox::textChanged( const QString &string )  This signal is useful for editable comboboxes. It is emitted whenever  the contents of the text entry field changes.*/class QComboBoxPopup : public QPopupMenu{public:    int itemHeight( int index )    {	return QPopupMenu::itemHeight( index );    }};struct QComboData{    QComboData( QComboBox *cb ): usingLBox( FALSE ), pop( 0 ), lBox( 0 ), combo( cb )    {	duplicatesEnabled = TRUE;	cb->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );    }    ~QComboData()    {	delete pop;    }    bool usingListBox()  { return usingLBox; }    QListBox * listBox() { ASSERT(usingLBox); return lBox; }    QComboBoxPopup * popup() { ASSERT(!usingLBox); return pop; }    void updateLinedGeometry();    void setListBox( QListBox *l ) { lBox = l ; usingLBox = TRUE;    				l->setMouseTracking( TRUE );}    void setPopupMenu( QComboBoxPopup * pm ) { pop = pm; usingLBox = FALSE; }    int		current;    int		maxCount;    int		sizeLimit;    QComboBox::Policy p;    bool	autoresize;    bool	poppedUp;    bool	mouseWasInsidePopup;    bool	arrowPressed;    bool	arrowDown;#ifdef Q_WS_REPLAYSONPOPDOWN    bool	discardNextMousePress;#endif    bool	shortClick;    bool	useCompletion;    bool	completeNow;    int		completeAt;    bool duplicatesEnabled;    int fullHeight, currHeight;    QLineEdit * ed;  // /bin/ed rules!    QSize sizeHint;#ifdef QT_KEYPAD_MODE    QString orgTxt;#endifprivate:    bool	usingLBox;    QComboBoxPopup *pop;    QListBox   *lBox;    QComboBox *combo;};void QComboData::updateLinedGeometry(){    if ( !ed || !combo )	return;    if ( current == 0 && combo->count() == 0 ) {	ed->setGeometry( combo->style().comboButtonRect( 0, 0, combo->width(), combo->height() ) );	return;    }    const QPixmap *pix = current < combo->count() ? combo->pixmap( current ) : 0;    QRect r( combo->style().comboButtonRect( 0, 0, combo->width(), combo->height() ) );    if ( pix && pix->width() < r.width() )	r.setLeft( r.left() + pix->width() + 4 );    if ( r != ed->geometry() )	ed->setGeometry( r );}bool QComboBox::getMetrics( int *dist, int *buttonW, int *buttonH ) const{    if ( d->usingListBox() && style() == WindowsStyle ) {	QRect r  = arrowRect();	*buttonW = r.width();	*buttonH = r.height();	*dist    = 4;    } else if ( d->usingListBox() ) {	*dist = 6;	*buttonW = 16;	*buttonH = 18;    } else {	*dist     = 8;	*buttonH  = 7;	*buttonW  = 11;    }    return TRUE;}static inline bool checkInsertIndex( const char *method, const char * name,				     int count, int *index){    bool range_err = (*index > count);#if defined(CHECK_RANGE)    if ( range_err )	qWarning( "QComboBox::%s: (%s) Index %d out of range",		 method, name ? name : "<no name>", *index );#else    Q_UNUSED( method )    Q_UNUSED( name )#endif    if ( *index < 0 )				// append	*index = count;    return !range_err;}static inline bool checkIndex( const char *method, const char * name,			       int count, int index ){    bool range_err = (index >= count);#if defined(CHECK_RANGE)    if ( range_err )	qWarning( "QComboBox::%s: (%s) Index %i out of range",		 method, name ? name : "<no name>", index );#else    Q_UNUSED( method )    Q_UNUSED( name )#endif    return !range_err;}/*!  Constructs a combo box widget with a parent and a name.  This constructor creates a popup menu if the program uses Motif look  and feel; this is compatible with Motif 1.x.*/QComboBox::QComboBox( QWidget *parent, const char *name )    : QWidget( parent, name, WResizeNoErase ){    d = new QComboData( this );    if ( style() == WindowsStyle ) {	setUpListBox();    } else {	d->setPopupMenu( new QComboBoxPopup );	d->popup()->setFont( font() );	connect( d->popup(), SIGNAL(activated(int)),			     SLOT(internalActivate(int)) );	connect( d->popup(), SIGNAL(highlighted(int)),			     SLOT(internalHighlight(int)) );    }    d->ed                    = 0;    d->current               = 0;    d->maxCount              = INT_MAX;    d->sizeLimit	     = 10;    d->p                    =  AtBottom;    d->autoresize            = FALSE;    d->poppedUp              = FALSE;    d->arrowDown             = FALSE;#ifdef Q_WS_REPLAYSONPOPDOWN    d->discardNextMousePress = FALSE;#endif    d->shortClick            = FALSE;    d->useCompletion = FALSE;    setFocusPolicy( TabFocus );    setPalettePropagation( AllChildren );    setFontPropagation( AllChildren );}/*!  Constructs a combo box with a maximum size and either Motif 2.0 or  Windows look and feel.  The input field can be edited if \a rw is TRUE, otherwise the user  may only choose one of the items in the combo box.*/QComboBox::QComboBox( bool rw, QWidget *parent, const char *name )    : QWidget( parent, name, WResizeNoErase ){    d = new QComboData( this );    setUpListBox();    d->current = 0;    d->maxCount = INT_MAX;    setSizeLimit(10);    d->p = AtBottom;    d->autoresize = FALSE;    d->poppedUp = FALSE;    d->arrowDown = FALSE;#ifdef Q_WS_REPLAYSONPOPDOWN    d->discardNextMousePress = FALSE;#endif    d->shortClick = FALSE;    d->useCompletion = FALSE;    setFocusPolicy( StrongFocus );    d->ed = 0;    if ( rw )	setUpLineEdit();#ifdef QT_KEYPAD_MODE    if( qt_modalEditingEnabled )	setBackgroundMode( PaletteBackground );    else#endif	setBackgroundMode( PaletteButton );    setPalettePropagation( AllChildren );    setFontPropagation( AllChildren );}/*!  Destructs the combo box.*/QComboBox::~QComboBox(){    delete d;}/*!  If the combobox is editable and the user enters some text in  the lineedit of the combobox and presses return (and the insertionPolicy()  is different from \c NoInsertion), the entered text is inserted into the  list of this combobox. Now, if you set \a enable to TRUE here,  this new text is always inserted, else it's only inserted if it  doesn't already exist in the list. If you set \a enable to FALSE  and the text exists already in the list, the item which contains  the same text like which should be inserted, this item  gets the new current item.  This setting only applies when the user want's to insert a text  with pressing the return key. It does \e not affect methods like  insertItem() and similar.*/void QComboBox::setDuplicatesEnabled( bool enable ){   d->duplicatesEnabled = enable;}/*!  Returns TRUE if the same text can be inserted multiple times  into the list of the combobox, else FALSE.  \sa setDuplicatesEnabled();*/bool QComboBox::duplicatesEnabled() const{    return d->duplicatesEnabled;}/*!  Returns the number of items in the combo box.*/int QComboBox::count() const{    if ( d->usingListBox() )	return d->listBox()->count();    else	return d->popup()->count();}/*!  \overload*/void QComboBox::insertStrList( const QStrList &list, int index ){    insertStrList( &list, index );}/*!  Inserts the list of strings at the index \e index in the combo box.  This is only for compatibility, as it does not support Unicode  strings.  See insertStringList().*/void QComboBox::insertStrList( const QStrList *list, int index ){    if ( !list ) {#if defined(CHECK_NULL)	ASSERT( list != 0 );#endif	return;    }    QStrListIterator it( *list );    const char* tmp;    if ( index < 0 )	index = count();    while ( (tmp=it.current()) ) {	++it;	if ( d->usingListBox() )	    d->listBox()->insertItem( QString::fromLatin1(tmp), index );	else	    d->popup()->insertItem( QString::fromLatin1(tmp), index, index );	if ( index++ == d->current && d->current < count() ) {	    if ( d->ed ) {		d->ed->setText( text( d->current ) );		d->updateLinedGeometry();	    } else		update();	    currentChanged();	}    }    if ( index != count() )	reIndex();}/*!  Inserts the list of strings at the index \e index in the combo box.*/void QComboBox::insertStringList( const QStringList &list, int index ){    QStringList::ConstIterator it = list.begin();    if ( index < 0 )	index = count();    while ( it != list.end() ) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区高清| 欧美日韩另类国产亚洲欧美一级| 亚洲精品国久久99热| 欧美日本国产一区| 成人一区二区三区| 久久国产精品第一页| 自拍偷拍亚洲激情| 精品久久一区二区三区| 欧美性高清videossexo| 不卡av电影在线播放| 免费人成精品欧美精品| 亚洲色图在线播放| 国产亚洲欧洲997久久综合| 欧美日韩精品二区第二页| 99久久夜色精品国产网站| 久久99精品国产.久久久久| 亚洲卡通动漫在线| 国产精品久久久久久久久图文区 | 99精品国产热久久91蜜凸| 久久99精品久久久久久国产越南| 亚洲va在线va天堂| 最近日韩中文字幕| 欧美高清在线视频| 26uuu国产一区二区三区| 日韩一区二区免费视频| 欧美午夜寂寞影院| 欧洲亚洲国产日韩| 色天天综合色天天久久| eeuss鲁片一区二区三区在线看| 激情六月婷婷综合| 国精品**一区二区三区在线蜜桃| 琪琪久久久久日韩精品| 丝袜诱惑制服诱惑色一区在线观看| 一区二区三区在线视频免费| 亚洲免费av高清| 亚洲日本在线天堂| 亚洲欧美激情小说另类| 综合久久国产九一剧情麻豆| 国产精品福利影院| 亚洲欧美一区二区三区久本道91| 国产亚洲人成网站| 国产亚洲精品久| 国产精品国产三级国产普通话三级| 国产精品麻豆一区二区| 亚洲图片欧美激情| 亚洲欧美国产77777| 一区二区三区不卡视频在线观看| 亚洲尤物视频在线| 三级欧美在线一区| 男人操女人的视频在线观看欧美| 久久99精品国产麻豆婷婷洗澡| 日韩和欧美的一区| 久久国产尿小便嘘嘘| 国产一区二区三区综合| 国产成人免费高清| 91在线丨porny丨国产| 在线观看欧美日本| 欧美一区二区三区思思人| 日韩欧美aaaaaa| 26uuu色噜噜精品一区| 国产精品女同一区二区三区| 亚洲综合小说图片| 久久精品99久久久| 成人国产免费视频| 欧日韩精品视频| 欧美电影免费观看高清完整版在线 | 国产一区二区女| 成人国产亚洲欧美成人综合网| 色视频一区二区| 在线成人av影院| 久久久久久久久岛国免费| 国产精品天干天干在线综合| 亚洲综合自拍偷拍| 另类欧美日韩国产在线| 成人黄色国产精品网站大全在线免费观看| 91免费在线视频观看| 欧美精品乱码久久久久久| 2020国产成人综合网| 亚洲免费伊人电影| 青青草国产精品亚洲专区无| 高清不卡在线观看av| 欧美色综合久久| 久久久久久久久99精品| 亚洲一区二区在线观看视频| 国产做a爰片久久毛片| 色综合亚洲欧洲| 精品国产亚洲在线| 亚洲免费观看高清| 精久久久久久久久久久| 91在线观看高清| 欧美不卡一区二区三区| 亚洲人成网站色在线观看| 青娱乐精品在线视频| 92国产精品观看| 欧美www视频| 亚洲成a人片在线观看中文| 国产伦精品一区二区三区免费| 欧美亚洲愉拍一区二区| 国产午夜久久久久| 男女性色大片免费观看一区二区 | 91免费版在线| 2020国产成人综合网| 亚洲成av人片| www.色综合.com| 久久久久久久电影| 偷偷要91色婷婷| 色婷婷亚洲精品| 国产精品欧美经典| 国内欧美视频一区二区| 欧美精品第1页| 亚洲久草在线视频| 99久久伊人精品| 国产精品嫩草久久久久| 裸体一区二区三区| 欧美日韩在线观看一区二区| 中文字幕在线不卡一区| 蜜桃精品视频在线| 欧美精品第1页| 午夜视频一区二区| 在线免费一区三区| 亚洲蜜臀av乱码久久精品蜜桃| 成人一区二区三区中文字幕| 欧美一区二区三区系列电影| 午夜精品久久一牛影视| 欧美日韩精品一区二区在线播放 | 国产suv一区二区三区88区| 精品久久五月天| 久久99这里只有精品| 精品国产免费人成在线观看| 蜜桃视频在线观看一区二区| 欧美一区二区黄| 日本欧美一区二区在线观看| 8v天堂国产在线一区二区| 午夜精品久久久久久久久久久| 欧美色成人综合| 亚洲国产欧美另类丝袜| 在线视频欧美精品| 亚洲国产精品久久不卡毛片| 欧美色综合网站| 日韩经典中文字幕一区| 9191成人精品久久| 石原莉奈一区二区三区在线观看| 欧美精品自拍偷拍| 日本在线播放一区二区三区| 欧美一级片免费看| 美女免费视频一区| 精品美女一区二区三区| 国产综合一区二区| 国产精品污网站| 94-欧美-setu| 午夜私人影院久久久久| 欧美一二三区在线| 国产乱码精品一品二品| 国产精品水嫩水嫩| 色88888久久久久久影院野外| 亚洲成人免费观看| 日韩午夜激情免费电影| 狠狠色丁香九九婷婷综合五月| 国产欧美日韩亚州综合| 色综合网站在线| 日本va欧美va精品| 久久久久国产精品麻豆ai换脸| 成人午夜伦理影院| 亚洲不卡在线观看| 精品av久久707| 色欧美片视频在线观看在线视频| 亚洲第一搞黄网站| 精品免费视频.| 99久久精品久久久久久清纯| 首页国产欧美日韩丝袜| 久久久久久久久久久久久久久99| 91女神在线视频| 美国十次综合导航| 成人欧美一区二区三区在线播放| 欧洲生活片亚洲生活在线观看| 久久国产麻豆精品| 国产精品色呦呦| 制服丝袜av成人在线看| 福利一区福利二区| 亚洲a一区二区| 国产精品美日韩| 制服丝袜一区二区三区| 国产91富婆露脸刺激对白| 亚洲一二三区视频在线观看| 久久免费偷拍视频| 欧美日韩国产小视频在线观看| 国产成人在线免费| 天天色综合天天| 亚洲欧美另类在线| 欧美精品一区二区三区一线天视频 | 亚洲国产成人午夜在线一区| 欧美久久久久免费| 成人免费高清在线| 麻豆精品在线播放| 亚洲美女区一区| 国产日本一区二区| 91精品免费在线观看| 91亚洲精品久久久蜜桃网站| 国内精品免费**视频| 亚洲自拍都市欧美小说|