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

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

?? qmultilineedit.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
    if ( mark && !hasMarkedText() ) {	markAnchorX    = cursorX;	markAnchorY    = cursorY;    }    if ( !curXPos )	curXPos = mapToView( cursorX, cursorY );    int oldY = cursorY;    if ( newTopCell != topCell() ) {	cursorY = QMIN( newTopCell + delta, numLines() - 1 );	if ( partial )	    cursorY--;	cursorX = mapFromView( curXPos, cursorY );	if ( mark )	    newMark( cursorX, cursorY, FALSE );	setTopCell( newTopCell );    } else { // just move the cursor	cursorY = QMAX( cursorY - pageSize, 0 );	cursorX = mapFromView( curXPos, cursorY );	if ( mark )	    newMark( cursorX, cursorY, FALSE );    }    if ( oldAuto )	if ( mark ) {	    setAutoUpdate( TRUE );	    update();	} else {	    updateCell( oldY, 0, FALSE );	}    if ( !mark )	turnMark( FALSE );}// THE CORE INSERTION FUNCTIONvoid QMultiLineEdit::insertAtAux( const QString &txt, int line, int col, bool mark ){    // don't check for compose end.  this is used by compose events as well.    dummy = FALSE;    d->blinkTimer->stop();    cursorOn = TRUE;    int oldw = contentsRect().width();    line = QMAX( QMIN( line, numLines() - 1), 0 );    col = QMAX( QMIN( col,  lineLength( line )), 0 );    QString itxt = txt;    QMultiLineEditRow  *row = contents->at( line );    if ( d->maxlen >= 0 && length() + int(txt.length()) > d->maxlen )	itxt.truncate( d->maxlen - length() );    row->s.insert( uint(col), itxt );    if ( mark ) {	markAnchorX = col;	markAnchorY = line;    }    if ( cursorX == col && cursorY == line ) {	cursorX += itxt.length();    }    QFontMetrics fm( font() );    if ( !WORD_WRAP || ( col == 0 && itxt.contains('\n') == int(itxt.length())) )	wrapLine( line, 0 );    else if ( WORD_WRAP && itxt.find('\n')<0 && itxt.find('\t')<0	      && (		  ( DYNAMIC_WRAP && fm.width( itxt ) + row->w < contentsRect().width() -  2*d->lr_marg - d->marg_extra )		  ||		  ( FIXED_WIDTH_WRAP && ( d->wrapcol < 0 || fm.width( itxt ) + row->w < d->wrapcol ) )		  ||		  ( FIXED_COLUMN_WRAP && ( d->wrapcol < 0 || int(row->s.length()) < d->wrapcol ) )		  )	      && ( itxt.find(' ') < 0 || row->s.find(' ') >= 0 && row->s.find(' ') < col ) ){	row->w = textWidth( row->s );	setWidth( QMAX( maxLineWidth(), row->w) );	updateCell( line, 0, FALSE );    }    else {	if ( line > 0 && !contents->at( line-1)->newline )	    rebreakParagraph( line-1 );	else	    rebreakParagraph( line );    }    if ( mark )	newMark( cursorX, cursorY, FALSE );    setNumRowsAndTruncate();    textDirty = TRUE;    d->edited = TRUE;    if ( autoUpdate() ) {	makeVisible();	d->blinkTimer->start( QApplication::cursorFlashTime() / 2, FALSE );	if ( DYNAMIC_WRAP && oldw != contentsRect().width() ) {	    setAutoUpdate( FALSE );	    rebreakAll();	    setAutoUpdate( TRUE );	    update();	}    }}/*!  Inserts \a txt at line number \a line. If \a line is less than zero,  or larger than the number of rows, the new text is put at the end.  If \a txt contains newline characters, several lines are inserted.  The cursor position is not changed.*/void QMultiLineEdit::insertLine( const QString &txt, int line ){    QString s = txt;    int oldXPos = cursorX;    int oldYPos = cursorY;    if ( line < 0 || line >= int( contents->count() ) ) {	if ( !dummy )	    contents->append( new QMultiLineEditRow(QString::fromLatin1(""), 0) );	insertAt( s, numLines()-1, 0 );    } else {	s.append('\n');	insertAt( s, line, 0 );    }    cursorX = oldXPos;    cursorY = oldYPos;}/*!  Deletes the line at line number \a line. If \a  line is less than zero, or larger than the number of lines,  no line is deleted.*/void QMultiLineEdit::removeLine( int line ){    CLEAR_UNDO    if ( line >= numLines()  )	return;    if ( cursorY >= line && cursorY > 0 )	cursorY--;    bool updt = autoUpdate() && rowIsVisible( line );    QMultiLineEditRow* r = contents->at( line );    ASSERT( r );    bool recalc = r->w == maxLineWidth();    contents->remove( line );    if ( contents->count() == 0 ) {	int w  = textWidth( QString::fromLatin1("") );	contents->append( new QMultiLineEditRow(QString::fromLatin1(""), w) );	setWidth( w );	dummy = TRUE;    }    if ( setNumRowsAndTruncate() )	recalc = updt = FALSE;    if ( recalc )	updateCellWidth();    makeVisible();    if (updt)	update();    textDirty = TRUE;    d->edited = TRUE;}/*!  Inserts \a s at the current cursor position.*/void QMultiLineEdit::insert( const QString& s ){    insert( s, FALSE );}/*!  Inserts \a c at the current cursor position.  (this function is provided for backward compatibility -  it simply calls insert()).*/void QMultiLineEdit::insertChar( QChar c ){    insert(c);}/*!  Inserts \a c at the current cursor position.*/void QMultiLineEdit::insert( const QString& str, bool mark ){    dummy = FALSE;    bool wasMarkedText = hasMarkedText();    if ( wasMarkedText )	addUndoCmd( new QBeginCommand );    if ( wasMarkedText )	del();					// ## Will flicker    QString *s = getString( cursorY );    if ( cursorX > (int)s->length() )	cursorX = s->length();    else if ( overWrite && !wasMarkedText && cursorX < (int)s->length() )	del();                                 // ## Will flicker    insertAt(str, cursorY, cursorX, mark );    makeVisible();    if ( wasMarkedText )	addUndoCmd( new QEndCommand() );}/*!  Makes a line break at the current cursor position.*/void QMultiLineEdit::newLine(){    insert("\n");}/*!  Deletes text from the current cursor position to the end of the line.*/void QMultiLineEdit::killLineAux(){    deselect(); // -sanders Don't let del() delete marked region    QMultiLineEditRow* r = contents->at( cursorY );    if ( cursorX == (int)r->s.length() ) {	//      if (r->newline) // -sanders Only del newlines!	del();	return;    } else {	bool recalc = r->w == maxLineWidth();	r->s.remove( cursorX, r->s.length() );	r->w = textWidth( r->s );	updateCell( cursorY, 0, FALSE );	if ( recalc )	    updateCellWidth();	rebreakParagraph( cursorY ); // -sanders	textDirty = TRUE;	d->edited = TRUE;    }    curXPos  = 0;    makeVisible();    turnMark( FALSE );}/*!  Moves the cursor one character to the left. If \a mark is TRUE, the text  is marked. If \a wrap is TRUE, the cursor moves to the end of the  previous line  if it is placed at the beginning of the current line.  \sa cursorRight() cursorUp() cursorDown()*/void QMultiLineEdit::cursorLeft( bool mark, bool wrap ){    cursorLeft(mark,!mark,wrap);}void QMultiLineEdit::cursorLeft( bool mark, bool clear_mark, bool wrap ){    if ( cursorX != 0 || cursorY != 0 && wrap ) {	if ( mark && !hasMarkedText() ) {	    markAnchorX    = cursorX;	    markAnchorY    = cursorY;	}	d->blinkTimer->stop();	int ll = lineLength( cursorY );	if ( cursorX > ll )	    cursorX = ll;	cursorOn = TRUE;	cursorX--;	if ( cursorX < 0 ) {	    int oldY = cursorY;	    if ( cursorY > 0 ) {		cursorY--;		cursorX = lineLength( cursorY );		if ( cursorX > 1 && !isEndOfParagraph( cursorY ) )		    cursorX--;	    } else {		cursorY = 0; //### ?		cursorX = 0;	    }	    updateCell( oldY, 0, FALSE );	}	if ( mark )	    newMark( cursorX, cursorY, FALSE );	d->blinkTimer->start( QApplication::cursorFlashTime() / 2, FALSE );	updateCell( cursorY, 0, FALSE );    }    curXPos  = 0;    makeVisible();    if ( clear_mark )	turnMark( FALSE );#ifdef QT_KEYPAD_MODE    if( qt_modalEditingEnabled ) {	if (d->extraNewLineCount && cursorY == (int)contents->count() - 2	    && lineLength(numLines()-1) == 0) {	    del();	    d->extraNewLineCount--;	}    }#endif}/*!  Moves the cursor one character to the right.  If \a mark is TRUE, the text  is marked. If \a wrap is TRUE, the cursor moves to the beginning of the next  line if it is placed at the end of the current line.  \sa cursorLeft() cursorUp() cursorDown()*/void QMultiLineEdit::cursorRight( bool mark, bool wrap ){    cursorRight(mark,!mark,wrap);}void QMultiLineEdit::cursorRight( bool mark, bool clear_mark, bool wrap ){    int strl = lineLength( cursorY );    if ( strl > 1 && !isEndOfParagraph( cursorY ) )	 strl--;    if ( cursorX < strl || cursorY < (int)contents->count() - 1 && wrap ) {	if ( mark && !hasMarkedText() ) {	    markAnchorX    = cursorX;	    markAnchorY    = cursorY;	}	d->blinkTimer->stop();	cursorOn = TRUE;	cursorX++;	if ( cursorX > strl ) {	    int oldY = cursorY;	    if ( cursorY < (int) contents->count() - 1 ) {		cursorY++;		cursorX = 0;	    } else {		cursorX = lineLength( cursorY );	    }	    updateCell( oldY, 0, FALSE );	}	if ( mark )	    newMark( cursorX, cursorY, FALSE );	updateCell( cursorY, 0, FALSE );	d->blinkTimer->start( QApplication::cursorFlashTime() / 2, FALSE );    }    curXPos  = 0;    makeVisible();    if ( clear_mark )	turnMark( FALSE );}/*!  Moves the cursor up one line.  If \a mark is TRUE, the text  is marked.  \sa cursorDown() cursorLeft() cursorRight()*/void QMultiLineEdit::cursorUp( bool mark ){    cursorUp(mark,!mark);}void QMultiLineEdit::cursorUp( bool mark, bool clear_mark ){#ifdef QT_KEYPAD_MODE    if ( qt_modalEditingEnabled && d->extraNewLineCount && cursorY == numLines() - 1	&& lineLength(numLines()-1) == 0 && !mark) {	backspace();  // this will decrement d->extraNewLineCount	home(FALSE);    } else#endif    if ( cursorY != 0 ) {	if ( mark && !hasMarkedText() ) {	    markAnchorX    = cursorX;	    markAnchorY    = cursorY;	}	if ( !curXPos )	    curXPos = mapToView( cursorX, cursorY );	int oldY = cursorY;	d->blinkTimer->stop();	cursorOn = TRUE;	cursorY--;	if ( cursorY < 0 ) {	    cursorY = 0;	}	cursorX = mapFromView( curXPos, cursorY );	if ( mark )	    newMark( cursorX, cursorY, FALSE );	updateCell( oldY, 0, FALSE );	updateCell( cursorY, 0, FALSE );	d->blinkTimer->start( QApplication::cursorFlashTime() / 2, FALSE );    }    makeVisible();    if ( clear_mark )	turnMark( FALSE );}/*!  Moves the cursor one line down.  If \a mark is TRUE, the text  is marked.  \sa cursorUp() cursorLeft() cursorRight()*/void QMultiLineEdit::cursorDown( bool mark ){    cursorDown(mark,!mark);}void QMultiLineEdit::cursorDown( bool mark, bool clear_mark ){    int lastLin = contents->count() - 1;#ifdef QT_KEYPAD_MODE    if( qt_modalEditingEnabled ) {	if ( cursorY == lastLin ) {	    // automatically add newlines.	    insertAt( "\n", numLines()-1, lineLength(numLines()-1), mark );	    d->extraNewLineCount++;	    lastLin = contents->count() - 1;	}    }#endif    if ( cursorY != lastLin ) {	if ( mark && !hasMarkedText() ) {	    markAnchorX    = cursorX;	    markAnchorY    = cursorY;	}	if ( !curXPos )	    curXPos = mapToView( cursorX, cursorY );	int oldY = cursorY;	d->blinkTimer->stop();	cursorOn = TRUE;	cursorY++;	if ( cursorY > lastLin ) {	    cursorY = lastLin;	}	cursorX = mapFromView( curXPos, cursorY );	if ( mark )	    newMark( cursorX, cursorY, FALSE );	updateCell( oldY, 0, FALSE );	updateCell( cursorY, 0, FALSE );	d->blinkTimer->start( QApplication::cursorFlashTime() / 2, FALSE );    }    makeVisible();    if ( clear_mark )	turnMark( FALSE );}/*!  Turns off marked text*/void QMultiLineEdit::turnMark( bool on ){    if ( on != markIsOn ) {	markIsOn = on;	if ( echoMode() == Normal )	    emit copyAvailable( on );	update();    }}/*!  Deletes the character on the left side of the text cursor and moves  the cursor one position to the left. If a text has been marked by  the user (e.g. by clicking and dragging) the cursor is put at the  beginning of the marked text and the marked text is removed.  \sa del()*/void QMultiLineEdit::backspace(){    if ( hasMarkedText() ) {	del();    } else {	if ( !atBeginning() ) {	    cursorLeft( FALSE );	    del();	}    }    makeVisible();}void	QMultiLineEdit::removeText( int markBeginY, int markBeginX,				    int markEndY, int markEndX ){	textDirty = TRUE;	d->edited = TRUE;	if ( markBeginY == markEndY ) { //just one line	    QMultiLineEditRow *r = contents->at( markBeginY );	    ASSERT(r);	    bool recalc = r->w == maxLineWidth();	    r->s.remove( markBeginX, markEndX - markBeginX );	    r->w = textWidth( r->s );	    cursorX  = markBeginX;	    cursorY  = markBeginY;	    if (autoUpdate() )		updateCell( cursorY, 0, FALSE );	    if ( recalc )		updateCellWidth();	} else { //multiline	    bool oldAuto = autoUpdate();	    setAutoUpdate( FALSE );	    ASSERT( markBeginY >= 0);	    ASSERT( markEndY < (int)contents->count() );	    QMultiLineEditRow *firstR, *lastR;	    firstR = contents->at( markBeginY );	    lastR  = contents->at( markEndY );	    ASSERT( firstR != lastR );	    firstR->s.remove( markBeginX, firstR->s.length() - markBeginX  );	    lastR->s.remove( 0, markEndX  );	    firstR->s.append( lastR->s );  // lastS will be removed in loop below	    firstR->newline = lastR->newline; // Don't forget this -sanders	    firstR->w = textWidth( firstR->s );	    for( int i = markBeginY + 1 ; i <= markEndY ; i++ )		contents->remove( markBeginY + 1 );	    if ( contents->isEmpty() )		insertLine( QString::fromLatin1(""), -1 );	    cursorX  = markBeginX;	    cursorY  = markBeginY;	    curXPos  = 0;	    setNumRowsAndTruncate();	    updateCellWidth();	    setAutoUpdate( oldAuto );	    if ( autoUpdate() )		update();	}}void QMultiLineEdit::delAux(){    int markBeginX, markBeginY;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品婷婷国产综合久久竹菊| 麻豆成人在线观看| 成人午夜激情片| 国产精品网曝门| 99这里只有精品| 亚洲影院在线观看| 欧美精品在欧美一区二区少妇| 人人精品人人爱| 久久久久久久综合| 色综合网色综合| 亚洲激情一二三区| 日韩一区二区不卡| 国产精品77777竹菊影视小说| 国产精品免费av| 在线观看www91| 免费在线成人网| 国产午夜精品一区二区三区嫩草 | 同产精品九九九| 精品国产成人系列| 成人国产精品免费观看| 一区二区三区国产精华| 欧美一区二区高清| 欧美日韩情趣电影| 国产一区二区在线电影| 亚洲视频图片小说| 日韩欧美在线影院| 99国产精品国产精品毛片| 一区二区三区电影在线播| 日韩视频永久免费| 一本久道久久综合中文字幕 | 精品视频1区2区| 国产一区二区三区黄视频 | 中文字幕成人在线观看| 欧美亚洲日本国产| 狠狠色丁香婷综合久久| 亚洲最新视频在线播放| 久久综合色8888| 在线观看免费亚洲| 国产一区二区中文字幕| 三级欧美在线一区| 国产精品美女久久福利网站| 91精品国产综合久久久久久漫画| 岛国av在线一区| 美女看a上一区| 亚洲图片欧美色图| 国产日韩精品一区二区三区| 91.成人天堂一区| 93久久精品日日躁夜夜躁欧美| 久久国产三级精品| 亚洲成人www| 亚洲精品日产精品乱码不卡| 久久综合色婷婷| 91精品啪在线观看国产60岁| 在线日韩av片| 91玉足脚交白嫩脚丫在线播放| 国产一区三区三区| 久久99热99| 日韩电影在线免费观看| 精品一区免费av| 免费观看成人av| 午夜欧美在线一二页| 一区二区三区欧美亚洲| 亚洲美女视频在线| 国产精品初高中害羞小美女文| 国产亚洲欧美日韩在线一区| 26uuu亚洲| 精品欧美一区二区久久| 欧美一区二区福利在线| 欧美一区二区三区四区视频| 欧美精品xxxxbbbb| 777色狠狠一区二区三区| 欧美色爱综合网| 欧美日韩国产另类一区| 精品视频在线免费看| 欧美男人的天堂一二区| 欧美日韩国产区一| 欧美日本在线播放| 在线电影院国产精品| 欧美蜜桃一区二区三区| 制服丝袜成人动漫| 3d动漫精品啪啪一区二区竹菊| 欧美日韩综合在线| 91.xcao| 日韩精品在线一区| 久久综合狠狠综合久久激情| 亚洲精品在线三区| 久久久噜噜噜久久中文字幕色伊伊| 欧美一级欧美三级| 精品国偷自产国产一区| 久久久午夜精品| 国产精品网站一区| 亚洲精品综合在线| 亚洲成人一区二区| 免费在线观看精品| 欧美影院一区二区| 在线播放亚洲一区| 日韩欧美成人午夜| 中文av一区特黄| 亚洲女爱视频在线| 偷拍一区二区三区四区| 韩国v欧美v日本v亚洲v| 91在线一区二区| 欧美日韩你懂得| 久久这里都是精品| 亚洲色图.com| 日本成人中文字幕| 国产成人综合精品三级| 日本精品视频一区二区| 欧美一区二区三区日韩视频| 国产视频一区不卡| 亚洲美女精品一区| 日本视频免费一区| 岛国一区二区三区| 欧美福利视频一区| 国产欧美日韩麻豆91| 亚洲第一久久影院| 国产精品亚洲成人| 欧美猛男gaygay网站| 国产亚洲综合色| 亚洲国产精品久久久男人的天堂| 精品一区二区三区久久| 色婷婷综合久久久久中文| 日韩精品一区二区三区在线| 中文字幕一区二区三区在线播放 | av成人老司机| 欧美一区二区三区啪啪| 国产精品久久久久毛片软件| 奇米在线7777在线精品| 99精品久久久久久| 欧美精品一区视频| 亚洲专区一二三| 成人h精品动漫一区二区三区| 欧美精品一级二级| 中文字幕视频一区| 狠狠色丁香久久婷婷综| 欧美日韩精品高清| 国产精品久久久久久久久免费樱桃 | 亚洲精品一区二区三区在线观看 | 精品一区二区三区影院在线午夜 | 日韩丝袜美女视频| 亚洲色图制服诱惑| 国产精品羞羞答答xxdd| 欧美一区二区二区| 一区二区成人在线观看| www.在线成人| 中文字幕第一区综合| 国内精品写真在线观看| 欧美夫妻性生活| 依依成人精品视频| 99re在线精品| 国产精品免费看片| 国产精品1区二区.| 精品成人私密视频| 免费黄网站欧美| 欧美狂野另类xxxxoooo| 亚洲国产人成综合网站| 在线视频中文字幕一区二区| 一区二区三区在线观看视频| 99精品欧美一区二区三区小说| 欧美精彩视频一区二区三区| 国产一区二区主播在线| 久久综合色婷婷| 国产精品69久久久久水密桃| 久久精品网站免费观看| 国产一区欧美日韩| 久久久久久日产精品| 国产二区国产一区在线观看| 久久精品夜色噜噜亚洲a∨| 韩国女主播成人在线| 久久精品夜夜夜夜久久| 国产成人精品亚洲午夜麻豆| 中文字幕第一区二区| av影院午夜一区| 亚洲黄色性网站| 日本高清不卡视频| 亚洲第一狼人社区| 制服丝袜中文字幕一区| 免费成人深夜小野草| 精品粉嫩超白一线天av| 国产老妇另类xxxxx| 国产精品理论片| 色欲综合视频天天天| 亚洲国产日产av| 欧美变态凌虐bdsm| 国产乱一区二区| 国产精品久久福利| 欧美在线三级电影| 日韩精品欧美精品| 久久综合九色综合欧美98 | 一区二区激情视频| 3atv在线一区二区三区| 国产一区二区三区精品视频| 国产精品欧美一区喷水| 在线免费一区三区| 看电视剧不卡顿的网站| 亚洲国产精品99久久久久久久久| 91色porny蝌蚪| 免费欧美在线视频| 国产精品传媒视频| 91麻豆精品国产91久久久 |