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

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

?? qlineedit.cpp

?? qtopia-phone-2.2.0下公共的控件實現(xiàn)源代碼。
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
{    d->readonly = enable;}/*!  Returns whether the line-edit is read-only.  \sa setReadOnly()*/bool QLineEdit::isReadOnly() const{    return d->readonly;}/*!  Returns a recommended size for the widget.  The width returned is enough for a few characters, typically 15 to 20.*/QSize QLineEdit::sizeHint() const{    constPolish();    QFontMetrics fm( font() );    int h = fm.height();    int w = fm.width( 'x' ) * 17; // "some"    int hm = style().pixelMetric(QStyle::LineEditTextHMargin); // 2    int vm = style().pixelMetric(QStyle::LineEditTextVMargin); // 2    int il = style().pixelMetric(QStyle::IdealHeightLimit); // 25    int ih = style().pixelMetric(QStyle::IdealHeight); // 22    if ( frame() ) {	h += vm*2 + frameW()*2;	if ( style() == WindowsStyle && h <= il )	    h = ih;	return QSize( w + hm*2 + frameW()*2, h ).expandedTo( QApplication::globalStrut() );    } else {	return QSize( w + hm*2, h + vm*2 ).expandedTo( QApplication::globalStrut() );    }}/*!  Returns a minimum size for the line edit.  The width returned is enough for at least one character.*/QSize QLineEdit::minimumSizeHint() const{    constPolish();    QFontMetrics fm( font() );    int h = fm.height();    int w = fm.maxWidth();    int il = style().pixelMetric(QStyle::IdealHeightLimit); // 25    int ih = style().pixelMetric(QStyle::IdealHeight); // 22    if ( frame() ) {	h += 4 + frameW()*2;	if ( style() == WindowsStyle && h <= il )	    h = ih;	return QSize( w + 4 + frameW()*2, h );    } else {	return QSize( w + 4, h + 4 );    }}/*!\reimp*/QSizePolicy QLineEdit::sizePolicy() const{    //### removeme 3.0    return QWidget::sizePolicy();}/*!  Sets this line edit to accept input only as accepted by \a v,  allowing arbitrary constraints on the text which the user can edit.  If \a v == 0, remove the current input validator.  The default  is no input validator (ie. any input is accepted up to maxLength()).  \sa validator() QValidator*/void QLineEdit::setValidator( const QValidator * v ){    d->validator = v;}/*!  Returns a pointer to the current input validator, or 0 if no  validator has been set.  \sa setValidator()*/const QValidator * QLineEdit::validator() const{    return d ? d->validator : 0;}/*!  This slot is equivalent to setValidator( 0 ). */void QLineEdit::clearValidator(){    setValidator( 0 );}#ifndef QT_NO_DRAGANDDROP/*! \reimp*/void QLineEdit::dragEnterEvent( QDragEnterEvent *e ){    if ( !d->readonly && QTextDrag::canDecode(e) )	e->accept( rect() );}/*!\reimp*/void QLineEdit::dropEvent( QDropEvent *e ){    QString str;    QCString plain = "plain";    // try text/plain    bool decoded = QTextDrag::decode(e, str, plain);    // otherwise we'll accept any kind of text (like text/uri-list)    if (! decoded) decoded = QTextDrag::decode(e, str);    if ( !d->readonly && decoded) {	if ( e->source() == this && hasMarkedText() )	    del();	if ( !hasMarkedText() )	    setCursorPosition( xPosToCursorPos(e->pos().x()) );	insert( str );	e->accept();    } else {	e->ignore();    }}#endif // QT_NO_DRAGANDDROP/*!  This private slot handles cursor blinking. */void QLineEdit::blinkSlot(){    if ( hasFocus() || cursorOn ) {	cursorOn = !cursorOn;	if ( d->pm && !d->pmDirty && d->cursorRepaintRect.isValid() )	    repaint( d->cursorRepaintRect, FALSE );	else	    repaint( FALSE );    }    if ( hasFocus() )	d->blinkTimer.start( QApplication::cursorFlashTime()/2, TRUE );    else	d->blinkTimer.stop();}/*!  This private slot handles drag-scrolling. */void QLineEdit::dragScrollSlot(){    if ( !hasFocus() || !dragScrolling )	d->dragTimer.stop();    else if ( scrollingLeft )	cursorLeft( TRUE );    else	cursorRight( TRUE );}/*!  Validates and perhaps sets this line edit to contain \a newText  with the cursor at position newPos, with marked text from \a  newMarkAnchor to \a newMarkDrag.  Returns TRUE if it changes the line  edit and FALSE if it doesn't.  Linebreaks in \a newText are converted to spaces, and it is  truncated to maxLength() before testing its validity.  Repaints and emits textChanged() if appropriate.*/bool QLineEdit::validateAndSet( const QString &newText, int newPos,				int newMarkAnchor, int newMarkDrag ){#ifndef QT_NO_QWS_IM    forceIMEnd();#endif    QString t( newText );    for ( uint i=0; i<t.length(); i++ ) {	if ( t[(int)i] < ' ' )  // unprintable/linefeed becomes space	    t[(int)i] = ' ';    }    t.truncate( maxLength() );#ifndef QT_NO_VALIDATOR    const QValidator * v = validator();    if ( v && v->validate( t, newPos ) == QValidator::Invalid &&	 v->validate( tbuf, cursorPos ) != QValidator::Invalid ) {	return FALSE;    }#endif    bool tc = ( t != tbuf );    // okay, it succeeded    if ( newMarkDrag != markDrag ||	 newMarkAnchor != markAnchor ||	 newPos != cursorPos ||	 tc ) {	int minP = QMIN( cursorPos, minMark() );	int maxP = QMAX( cursorPos, maxMark() );	cursorPos = newPos;	markAnchor = newMarkAnchor;	markDrag = newMarkDrag;	minP = QMIN( minP, QMIN( cursorPos, minMark() ) );	int i = 0;	while( i < minP && t[i] == tbuf[i] )	    i++;	minP = i;	maxP = QMAX( maxP, QMAX( cursorPos, maxMark() ) );	if ( fontMetrics().width( t ) < fontMetrics().width( tbuf ) )	    maxP = t.length();	tbuf = t;	if ( cursorPos < (int)text().length() && maxP < (int)text().length() )	    maxP = text().length();	repaintArea( minP, maxP );    }    if ( tc ) {	ed = TRUE;	emit textChanged( tbuf );    }    return TRUE;}/*!  Removes any selected text, inserts \a newText,  validates the result and if it is valid, sets it as the new contents  of the line edit.*/void QLineEdit::insert( const QString &newText ){#ifndef QT_NO_QWS_IM    forceIMEnd();#endif    QString t( newText );    if ( t.isEmpty() && !hasMarkedText() )	return;    for ( int i=0; i<(int)t.length(); i++ )	if ( t[i] < ' ' )  // unprintable/linefeed becomes space	    t[i] = ' ';    QString test( tbuf );    int cp = cursorPos;    if ( d->undo && ( d->needundo || hasMarkedText() ) ) {	if ( d->undoList.isEmpty() || d->undoList.last().str != tbuf ) {	    d->undoList += QLineEditUndoItem(tbuf, cursorPos );	    d->redoList.clear();	    d->needundo = FALSE;	}    }    if ( hasMarkedText() ) {	test.remove( minMark(), maxMark() - minMark() );	cp = minMark();    }    test.insert( cp, t );    int ncp = QMIN( cp+t.length(), (uint)maxLength() );    validateAndSet( test, ncp, ncp, ncp );    blinkOn();}/*!  Repaints all characters from \a from to \a to.  If cursorPos is  between from and to, ensures that cursorPos is visible.  */void QLineEdit::repaintArea( int from, int to ){    QString buf = displayText();    int a, b;    if ( from < to ) {	a = from;	b = to;    } else {	a = to;	b = from;    }    d->pmDirty = TRUE;    int old = offset;    if ( d->offsetDirty || cursorPos >= a && cursorPos <= b )	updateOffset();    if ( !d->pmDirty || !isVisible() ) {	return;    } else if ( old != offset ) {	repaint( FALSE );	return;    }    QFontMetrics fm = fontMetrics();    int x = fm.width( buf.left( a ) ) + offset - 2 + frameW();    QRect r( x, 0, fm.width( buf.mid( a, b-a ) ) + 5, height() );    r = r.intersect( rect() );    if ( !r.isValid() )	return;    if ( b >= (int)buf.length() )	r.setRight( width() );    repaint( r, FALSE );}/*!  \reimp */void QLineEdit::setEnabled( bool e ){    d->pmDirty = TRUE;    QWidget::setEnabled( e );}/*! \reimp */void QLineEdit::setFont( const QFont & f ){    d->pmDirty     = TRUE;    d->offsetDirty = TRUE;    QWidget::setFont( f );}/*!  Syntactic sugar for setText( "" ), provided to match no-argument  signals.*/void QLineEdit::clear(){    setText( QString::fromLatin1("") );}/*!  Sets the marked area of this line edit to start at \a start and  be \a length characters long. */void QLineEdit::setSelection( int start, int length ){    int b, e;    b = QMIN( markAnchor, markDrag );    e = QMAX( markAnchor, markDrag );    b = QMIN( b, start );    e = QMAX( e, start + length );    markAnchor = start;    markDrag = start + length;    repaintArea( b, e );}/*!  Sets the cursor position for this line edit to \a newPos and  repaints accordingly.  \sa cursorPosition() */void QLineEdit::setCursorPosition( int newPos ){    if ( newPos == cursorPos )	return;    newPos = QMIN( newPos, (int)tbuf.length() );    newPos = QMAX( newPos, 0 );    int b, e;    b = QMIN( newPos, cursorPos );    e = QMAX( newPos, cursorPos );    cursorPos = newPos;    blinkOn();    repaintArea( b, e );}/*!  Returns the current cursor position for this line edit.  \sa  setCursorPosition() */int QLineEdit::cursorPosition() const{    return cursorPos;}/*! \reimp */void QLineEdit::setPalette( const QPalette & p ){    d->pmDirty = TRUE;    QWidget::setPalette( p );}/*!  Sets the edited flag of this line edit to \a on.  The edited flagis never read by QLineEdit, and is changed to TRUE whenever the userchanges its contents.This is useful e.g. for things that need to provide a default value,but cannot find the default at once.  Just open the line edit withoutthe best default and when the default is known, check the edited()return value and set the line edit's contents if the user has notstarted editing the line edit.\sa edited()*/void QLineEdit::setEdited( bool on ){    ed = on;}/*!  Returns the edited flag of the line edit.  If this returns FALSE,the line edit's contents have not been changed since the constructionof the QLineEdit (or the last call to either setText() or setEdited( FALSE ),if any).  If it returns true, the contents have been edited, orsetEdited( TRUE ) has been called.\sa setEdited()*/bool QLineEdit::edited() const{    return ed;}/*!  Moves the cursor one word to the right.  If \a mark is TRUE, the text  is marked.  \sa cursorWordBackward()*/void QLineEdit::cursorWordForward( bool mark ){    int i = cursorPos;    while ( i < (int) tbuf.length() && !tbuf[i].isSpace() )	++i;    while ( i < (int) tbuf.length() && tbuf[i].isSpace() )	++i;    cursorRight( mark, i - cursorPos );}/*!  Moves the cursor one word to the left.  If \a mark is TRUE, the text  is marked.  \sa cursorWordForward()*/void QLineEdit::cursorWordBackward( bool mark ){    int i = cursorPos;    while ( i > 0 && tbuf[i-1].isSpace() )	--i;    while ( i > 0 && !tbuf[i-1].isSpace() )	--i;    cursorLeft( mark, cursorPos - i );}void QLineEdit::updateOffset(){ // must not call repaint() - paintEvent() calls this    if ( !isVisible() ) {	d->offsetDirty = TRUE;	return;    }    d->offsetDirty = FALSE;    makePixmap();    QFontMetrics fm = fontMetrics();    int textWidth = fm.width( displayText() )+4;    int w = d->pm->width();    int old = offset;    if ( textWidth > w ) {	static const int rightDist = 2*fm.width("x");	static const int leftMargin = 2;	// may need to scroll.	QString dt = displayText();	int leftPos = fm.width( dt.left( QMAX( cursorPos-leftMargin, 0 ) ) );	int rightPos;#if !defined(QT_NO_QWS_IM)	if ( d->preeditSelLen )	    rightPos = fm.width( dt.left( cursorPos+d->preeditSelLen+1 ) );	else#endif	    rightPos = fm.width( dt.left( cursorPos ) ) + rightDist;		if ( rightPos + offset > w )	    offset = w - rightPos;	if ( leftPos + offset < 0 )	    offset = -leftPos;		//make sure we show as much as possible of the text:	if ( textWidth + offset < w )	    offset = w - textWidth;    } else {	if ( textWidth < 5 ) {	    // nothing is to be drawn.  okay.	    textWidth = QMIN( 5, w );	}	if ( alignmentFlag == Qt::AlignRight ) {	    // right-aligned text, space for all of it	    offset = w - textWidth;	} else if ( alignmentFlag == Qt::AlignCenter || alignmentFlag == Qt::AlignHCenter ) {	    // center-aligned text, space for all of it	    offset = (w - textWidth)/2;	} else {	    // default: left-aligned, space for all of it	    offset = 0;	}    }    if ( old == offset && !d->pmDirty )	return;    d->pmDirty = TRUE;}/*! Returns the index of the character to whose left edge \a goalx is  closest.*/int QLineEdit::xPosToCursorPos( int goalx ) const{    int x1, x2;    x1 = offset;    int i = 0;    QFontMetrics fm = fontMetrics();    QString s = displayText();    goalx -= (frameW() + 2);    while( i < (int) s.length() ) {	x2 = x1 + fm.width( s[i] );	if ( QABS( x1 - goalx ) < QABS( x2 - goalx ) )	    return i;	i++;	x1 = x2;    }    return i;}/*!  Starts the thing blinking, or makes sure it's displayed at once. */void QLineEdit::blinkOn(){    if ( !hasFocus() )	return;    d->blinkTimer.start( cursorOn?QApplication::cursorFlashTime() / 2 : 0, TRUE );    inBlinkOn = TRUE;    blinkSlot();    inBlinkOn = FALSE;}void QLineEdit::makePixmap() const{    if ( d->pm )	return;    QSize s( width() - frameW()*2, height() - frameW()*2 );    if ( s.width() < 0 )	s.setWidth( 0 );    if ( s.height() < 0 )	s.setHeight( 0 );    d->pm = new QPixmap( s );    d->pmDirty = TRUE;}void QLineEdit::undoInternal(){    if ( d->undoList.isEmpty() )	return;    d->undo = FALSE;    d->redoList += QLineEditUndoItem(tbuf, cursorPos );    setText( d->undoList.last().str );    setCursorPosition( d->undoList.last().pos );    markAnchor = cursorPos;    d->undoList.remove( d->undoList.fromLast() );    if ( d->undoList.count() > 10 )	d->undoList.remove( d->undoList.begin() );    d->undo = TRUE;    d->needundo = TRUE;}void QLineEdit::redoInternal(){    if ( d->redoList.isEmpty() )	return;    d->undo = FALSE;    d->undoList += QLineEditUndoItem(tbuf, cursorPos );    setText( d->redoList.last().str );    setCursorPosition( d->redoList.last().pos );    markAnchor = cursorPos;    d->redoList.remove( d->redoList.fromLast() );    d->undo = TRUE;    d->needundo = TRUE;}#endif#if defined(Q_INCOMPATIBLE_3_0_ADDONS)bool QLineEdit::getSelection( int *start, int *end ){    if( !hasMarkedText() )	return false;    *start = minMark();    *end = maxMark();    return true;}void QLineEdit::setPasswordChar( QChar c ){    d->passwordChar = c;}QChar QLineEdit::passwordChar() const{    return d->passwordChar;}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人一区二区| 成人亚洲一区二区一| 国产日韩亚洲欧美综合| 欧美日韩中文一区| 成人18精品视频| 久久精品国产免费看久久精品| 亚洲精选一二三| 日本一区二区综合亚洲| 欧美电影免费观看高清完整版| 一本大道av伊人久久综合| 国产在线播精品第三| 日韩二区三区四区| 亚洲老司机在线| 国产精品乱码一区二三区小蝌蚪| 欧美一区2区视频在线观看| 91久久一区二区| 99久久夜色精品国产网站| 狠狠久久亚洲欧美| 久久精品国产77777蜜臀| 亚洲成人高清在线| 亚洲一区自拍偷拍| 一区二区三区四区亚洲| 亚洲久本草在线中文字幕| 亚洲欧洲精品一区二区三区| 国产欧美精品一区二区色综合朱莉| 日韩午夜av一区| 日韩欧美一区电影| 日韩一区二区三区在线| 日韩视频中午一区| 欧美一区午夜视频在线观看| 欧美老女人在线| 欧美日韩国产影片| 欧美日韩aaaaa| 欧美一区二区精品久久911| 欧美精品v国产精品v日韩精品| 欧美日韩国产精选| 欧美日韩一卡二卡三卡 | 中文字幕一区二区三区在线不卡 | 国内精品伊人久久久久影院对白| 日本在线不卡视频| 免费欧美高清视频| 九色综合狠狠综合久久| 久久精品国产秦先生| 激情av综合网| 粉嫩一区二区三区性色av| 成人午夜电影久久影院| av成人老司机| 在线观看日韩一区| 欧美一区二区久久| 精品捆绑美女sm三区| 国产午夜精品一区二区| 亚洲国产岛国毛片在线| 《视频一区视频二区| 一区二区三区成人在线视频| 亚洲国产成人av| 麻豆精品在线播放| 国产九色sp调教91| 91免费国产在线| 717成人午夜免费福利电影| 欧美一区二区三区啪啪| 久久亚洲免费视频| 国产精品久久久一本精品| 亚洲综合视频在线观看| 日本网站在线观看一区二区三区| 久久99久久精品| 91影院在线免费观看| 欧美性高清videossexo| 精品国产制服丝袜高跟| 国产精品人人做人人爽人人添| 亚洲最大的成人av| 美女一区二区三区在线观看| 高清日韩电视剧大全免费| 在线观看一区二区视频| 日韩免费性生活视频播放| 国产精品乱码人人做人人爱| 亚洲成a人片在线观看中文| 国产一区激情在线| 一本大道久久a久久精品综合| 日韩一区二区三区电影在线观看 | 一区二区三区在线观看视频| 男女激情视频一区| 91一区一区三区| 精品区一区二区| 一区二区视频在线看| 麻豆免费精品视频| 欧洲精品中文字幕| 欧美精品一区视频| 亚洲一区二区三区视频在线播放| 激情综合色丁香一区二区| 在线免费观看视频一区| 国产亚洲一区二区三区四区| 亚洲综合一区二区精品导航| 国产精品99久久久久久宅男| 欧美日韩成人综合| 日韩久久一区二区| 国产一区二区三区观看| 欧美三级电影在线看| 中文字幕制服丝袜成人av| 日本不卡不码高清免费观看| 99精品视频一区二区| 精品福利二区三区| 日韩在线卡一卡二| 色综合久久久久久久久久久| 久久女同性恋中文字幕| 欧美aaa在线| 欧美视频在线观看一区二区| 国产精品白丝在线| 国产精品一区二区你懂的| 欧美va亚洲va| 丝袜亚洲精品中文字幕一区| 91蜜桃网址入口| 国产精品丝袜久久久久久app| 久久99精品久久只有精品| 欧美色电影在线| 亚洲午夜久久久久中文字幕久| 成人app在线观看| 国产免费成人在线视频| 加勒比av一区二区| 日韩亚洲欧美在线| 美女视频黄a大片欧美| 欧美肥大bbwbbw高潮| 亚洲午夜一区二区三区| 在线亚洲一区二区| 亚洲男人的天堂在线aⅴ视频| 北条麻妃一区二区三区| 国产亚洲欧美激情| 国产v综合v亚洲欧| 国产视频一区二区在线观看| 国产美女精品人人做人人爽| 欧美xxx久久| 国内欧美视频一区二区| 久久一区二区视频| 国产呦萝稀缺另类资源| 久久蜜桃av一区精品变态类天堂 | 欧美久久久久久蜜桃| 亚洲成人7777| 91麻豆精品国产91久久久更新时间| 亚洲午夜精品在线| 欧美精品黑人性xxxx| 麻豆一区二区在线| 久久毛片高清国产| 成年人国产精品| 伊人一区二区三区| 欧美日韩免费在线视频| 日本人妖一区二区| 精品国产百合女同互慰| 国产美女娇喘av呻吟久久| 国产精品久久影院| 欧美午夜一区二区三区免费大片| 亚洲不卡一区二区三区| 日韩一区二区电影在线| 国产乱码精品1区2区3区| 中文字幕欧美日本乱码一线二线| 成+人+亚洲+综合天堂| 亚洲一区二区精品视频| 69精品人人人人| 国产伦精品一区二区三区视频青涩 | 在线免费观看成人短视频| 午夜伦欧美伦电影理论片| 日韩欧美在线1卡| 国产成人一区二区精品非洲| 日韩伦理av电影| 91精品国产综合久久精品图片 | 日韩午夜电影在线观看| 国产精品亚洲成人| 亚洲美女屁股眼交3| 制服丝袜亚洲网站| 丁香亚洲综合激情啪啪综合| 一区二区三区在线观看动漫| 91精品欧美福利在线观看| 国产精品白丝jk白祙喷水网站 | 青青草91视频| 亚洲国产成人一区二区三区| 欧美午夜电影网| 国产在线播精品第三| 一区二区三区四区中文字幕| 日韩免费观看高清完整版在线观看| 成人在线一区二区三区| 日韩高清一区二区| 国产精品大尺度| 欧美不卡一二三| 色噜噜狠狠一区二区三区果冻| 蜜桃av噜噜一区二区三区小说| 中文字幕一区在线| 日韩一级片在线观看| 色综合网站在线| 国产精品1024| 日韩精品一级中文字幕精品视频免费观看 | youjizz久久| 久久精品国产一区二区| 亚洲自拍偷拍九九九| 久久色视频免费观看| 精品视频在线免费看| 成人免费毛片片v| 国产网站一区二区| 7777精品久久久大香线蕉| 91麻豆免费看片| 91福利国产成人精品照片| 麻豆一区二区三| 亚洲va欧美va国产va天堂影院|