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

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

?? qcombobox.cpp

?? qtopia-phone-2.2.0下公共的控件實現(xiàn)源代碼。
?? 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一区二区三区免费野_久草精品视频
亚洲欧美一区二区三区极速播放| 日本强好片久久久久久aaa| 日本伊人午夜精品| 欧美精品日韩一区| 一区二区欧美在线观看| 在线观看区一区二| 亚洲天堂中文字幕| 91高清在线观看| 夜夜嗨av一区二区三区| 色综合一区二区| 亚洲国产精品传媒在线观看| 国产传媒欧美日韩成人| 国产欧美综合在线观看第十页| 国内精品视频666| 中文字幕乱码亚洲精品一区 | 日韩小视频在线观看专区| 五月天激情综合| 久久先锋影音av鲁色资源网| 国产伦精一区二区三区| 日本一区二区久久| 在线看一区二区| 亚洲伦理在线精品| 91国产成人在线| 亚洲成人激情自拍| 精品剧情在线观看| 色综合一区二区| 麻豆91在线播放免费| 久久精品在这里| 欧美片在线播放| 懂色av一区二区三区免费看| 欧美国产在线观看| 91在线云播放| 国产在线一区观看| 亚洲一区在线视频| 久久精品人人做人人综合 | 日日欢夜夜爽一区| 国产精品每日更新在线播放网址| 欧美日韩国产影片| a亚洲天堂av| 国产91在线观看| 日本v片在线高清不卡在线观看| 久久精品在线观看| 日韩精品一区在线观看| 欧美高清视频不卡网| 91视频精品在这里| 99综合电影在线视频| 日韩精品欧美精品| 久久毛片高清国产| 精品成人免费观看| 日韩一级片网址| 777午夜精品免费视频| 一本色道综合亚洲| 91久久精品一区二区二区| 成人福利视频在线看| 国产成人免费xxxxxxxx| 成人在线一区二区三区| 国产剧情一区二区| 国产一区二区三区综合| 国模无码大尺度一区二区三区| 免费人成在线不卡| 日韩va欧美va亚洲va久久| 午夜在线成人av| 久草中文综合在线| 成人午夜精品在线| 欧美怡红院视频| 欧美大片日本大片免费观看| 日韩精品中午字幕| 亚洲素人一区二区| 丝袜美腿亚洲一区| 国产在线视频精品一区| 丁香天五香天堂综合| 色av成人天堂桃色av| 91精品国产免费| 777久久久精品| 国产欧美一区二区精品性色| 综合色中文字幕| 首页欧美精品中文字幕| 国产精选一区二区三区| 色8久久人人97超碰香蕉987| 日韩精品一区二区三区在线观看| 久久精品水蜜桃av综合天堂| 亚洲成人av电影在线| 国产精品小仙女| 欧美另类高清zo欧美| 国产精品久久影院| 国产综合色在线| 欧美精品三级日韩久久| 亚洲激情在线激情| 国产盗摄视频一区二区三区| 制服视频三区第一页精品| 国产精品国产精品国产专区不片| 伊人夜夜躁av伊人久久| av中文字幕一区| 国产精品久久久久一区| 国产揄拍国内精品对白| 欧美一区二区不卡视频| 亚洲成人在线网站| 在线看国产一区二区| 亚洲色图在线视频| 91网站最新地址| 亚洲人成在线播放网站岛国| 久久精品国产久精国产| 欧美日韩另类国产亚洲欧美一级| 亚洲婷婷国产精品电影人久久| 99久久er热在这里只有精品66| 国产欧美日韩激情| 成人精品视频网站| 亚洲婷婷综合久久一本伊一区| 国产高清在线精品| 国产午夜精品久久久久久久 | 欧美夫妻性生活| 婷婷丁香久久五月婷婷| 欧美综合欧美视频| 免费成人在线网站| 国产丝袜在线精品| 欧美主播一区二区三区美女| 亚洲成av人片在线| 久久久一区二区三区| 91香蕉视频黄| 久久国产精品99久久人人澡| 久久久www免费人成精品| 99久久精品久久久久久清纯| 一区二区三区欧美视频| 日韩精品中文字幕在线一区| 成人午夜激情片| 亚洲午夜av在线| 国产精品美女www爽爽爽| 欧美日本一道本| 国产久卡久卡久卡久卡视频精品| 亚洲欧洲在线观看av| 日韩精品一区二区三区在线播放| 国产激情精品久久久第一区二区 | 亚洲第一av色| 久久精品人人爽人人爽| 欧美日韩中文国产| va亚洲va日韩不卡在线观看| 欧美aⅴ一区二区三区视频| 中文字幕亚洲不卡| 国产欧美日韩久久| 精品国产免费人成电影在线观看四季| 91亚洲资源网| 99久久精品国产毛片| 国产九色精品成人porny| 免费观看一级欧美片| 五月天激情综合| 亚洲国产一区二区三区| 一区二区三区高清| 亚洲女与黑人做爰| 一区二区三区在线观看视频| 国产精品久久久久影院亚瑟| 久久婷婷国产综合国色天香| 欧美日韩国产综合一区二区 | 欧美精选一区二区| 欧美调教femdomvk| 国产福利一区二区| 奇米精品一区二区三区四区| 偷拍日韩校园综合在线| 天天色天天操综合| 午夜精品成人在线| 精彩视频一区二区三区| 国产在线国偷精品免费看| 国产成人8x视频一区二区| 精久久久久久久久久久| 国产成人在线免费| 99精品黄色片免费大全| 91福利视频网站| 日韩一区二区免费在线电影 | 精品国产麻豆免费人成网站| 久久伊人蜜桃av一区二区| 国产精品丝袜在线| 日韩中文字幕1| thepron国产精品| 欧美精选一区二区| 中文子幕无线码一区tr| 亚洲男人天堂一区| 久久精品国产亚洲a| youjizz国产精品| 欧美电视剧在线观看完整版| 国产精品二三区| 麻豆国产欧美日韩综合精品二区 | 91亚洲精华国产精华精华液| 色噜噜狠狠成人网p站| 欧美精品一区二区久久久| 樱桃国产成人精品视频| 免费高清视频精品| 欧美性色黄大片| 中文字幕制服丝袜一区二区三区 | 精品日韩欧美在线| 亚洲午夜久久久久| 91麻豆国产福利精品| 国产亚洲一区二区在线观看| 人人狠狠综合久久亚洲| 欧美色视频在线观看| 伊人一区二区三区| 一本久道久久综合中文字幕| 国产嫩草影院久久久久| 国产成人激情av| 中文欧美字幕免费| 99精品国产91久久久久久| 国产欧美一区二区三区沐欲|