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

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

?? qlineedit.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
/************************************************************************ $Id: qt/src/widgets/qlineedit.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QLineEdit widget class**** Created : 941011**** 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 "qlineedit.h"#ifndef QT_NO_LINEEDIT#include "qpainter.h"#include "qdrawutil.h"#include "qfontmetrics.h"#include "qpixmap.h"#include "qclipboard.h"#include "qapplication.h"#include "qvalidator.h"#include "qdragobject.h"#include "qtimer.h"#include "qpopupmenu.h"#include "qstringlist.h"#include "qguardedptr.h"#include <ctype.h>#if defined( _WS_QWS_ ) && !defined( QT_NO_QWS_IM )#include "qwsdisplay_qws.h"#endif#ifndef QT_NO_QWS_IM#include "../kernel/qinputcontext_p.h"#endif#ifdef QT_KEYPAD_MODEextern bool qt_modalEditingEnabled;#endifstruct QLineEditUndoItem{    QLineEditUndoItem(){pos=0;};    QLineEditUndoItem( const QString& s, int p )	: str(s),pos(p){}#if defined(Q_FULL_TEMPLATE_INSTANTIATION)    bool operator==( const QLineEditUndoItem& ) const { return FALSE; }#endif    QString str;    int pos;};enum {    IdUndo,    IdRedo,#ifndef QT_NO_CLIPBOARD    IdCut,    IdCopy,    IdPaste,#endif    IdClear,    IdSelectAll};struct QLineEditPrivate {    QLineEditPrivate( QLineEdit * l ):	frame(TRUE), mode(QLineEdit::Normal),	readonly(FALSE), validator( 0 ),	pm(0), pmDirty( TRUE ),	blinkTimer( l, "QLineEdit blink timer" ),	dragTimer( l, "QLineEdit drag timer" ),	dndTimer( l, "DnD Timer" ),	inDoubleClick( FALSE ), offsetDirty( FALSE ),	undo(TRUE), needundo( FALSE ), ignoreUndoWithDel( FALSE ),	mousePressed( FALSE ), dnd_primed( FALSE ), passwordChar( '*' )#ifndef QT_NO_QWS_IM        ,preeditStart(-1), preeditLength( 0 ), preeditCPos(-1), preeditSelLen(0)#endif#ifdef QT_KEYPAD_MODE	,deleteAllTimerId(-1)#endif#ifdef _WS_QWS_	,resumePassword( FALSE )#endif    {}    bool frame;    QLineEdit::EchoMode mode;    bool readonly;    const QValidator * validator;    QPixmap * pm;    bool pmDirty;    QTimer blinkTimer;    QTimer dragTimer, dndTimer;    QRect cursorRepaintRect;    bool inDoubleClick;    bool offsetDirty;    QValueList<QLineEditUndoItem> undoList;    QValueList<QLineEditUndoItem> redoList;    bool undo;    bool needundo;    bool ignoreUndoWithDel;    bool mousePressed;    QPoint dnd_startpos;    bool dnd_primed;    QChar passwordChar;#ifndef QT_NO_QWS_IM    int preeditStart;    int preeditLength;    int preeditCPos;    int preeditSelLen;#endif#ifdef QT_KEYPAD_MODE    QString orgTxt;    int deleteAllTimerId;#endif#ifdef _WS_QWS_    bool resumePassword;#endif};static bool inBlinkOn = FALSE;#ifndef QT_NO_QWS_IMextern QBrush *qt_im_compose_background;#endif// REVISED: arnt/*!  \class QLineEdit qlineedit.h  \brief The QLineEdit widget is a one-line text editor.  \ingroup basic  A line edit allows the user to enter and edit a single line of  plain text, with a useful collection of editing functions, including  undo & redo, cut & paste, and drag & drop.  By changing the echoMode() of a line edit it can also be used  as a "write-only" field, for inputs such as passwords.  The length of the field can be constrained to a maxLength(),  or the value can be arbitrarily constrained by setting a validator().  A closely related class is QMultiLineEdit which allows multi-line  editing.  The default QLineEdit object has its own frame as specified by the  Windows/Motif style guides, you can turn off the frame by calling  setFrame( FALSE ).  The default key bindings are described in keyPressEvent().  A right-mouse-button menu presents a number of the editing commands  to the user.  <img src=qlined-m.png> <img src=qlined-w.png>  \sa QMultiLineEdit QLabel QComboBox  <a href="guibooks.html#fowler">GUI Design Handbook: Field, Entry,</a>  <a href="guibooks.html#fowler">GUI Design Handbook: Field, Required.</a>*//*! \enum QLineEdit::EchoMode  This enum type describes how QLineEdit displays its  contents.  The defined values are:  <ul>  <li> \c Normal - display characters as they are entered.  This is	the default.  <li> \c NoEcho - do not display anything. This may be appropriate	for passwords where even the length of the password should	be kept secret.  <li> \c Password - display asterisks instead of the characters	actually entered.  </ul>  \sa setEchoMode() echoMode() QMultiLineEdit::EchoMode*//*!  \fn void QLineEdit::textChanged( const QString& )  This signal is emitted every time the text changes.  The argument is the new text.*/static const int scrollTime = 40;		// mark text scroll time/*!  Constructs a line edit with no text.  The maximum text length is set to 32767 characters.  The \e parent and \e name arguments are sent to the QWidget constructor.  \sa setText(), setMaxLength()*/QLineEdit::QLineEdit( QWidget *parent, const char *name )    : QWidget( parent, name, WRepaintNoErase ){    init();}/*!  Constructs a line edit containing the text \a contents.  The cursor position is set to the end of the line and the maximum text  length to 32767 characters.  The \e parent and \e name arguments are sent to the QWidget constructor.  \sa text(), setMaxLength()*/QLineEdit::QLineEdit( const QString & contents,		      QWidget *parent, const char *name )    : QWidget( parent, name ){    init();    setText( contents );}/*!  Destructs the line edit.*/QLineEdit::~QLineEdit(){    if ( d->pm )	delete d->pm;    delete d;}/*! Contains initialization common to both constructors. */void QLineEdit::init(){    d = new QLineEditPrivate( this );    connect( &d->blinkTimer, SIGNAL(timeout()),	     this, SLOT(blinkSlot()) );    connect( &d->dragTimer, SIGNAL(timeout()),	     this, SLOT(dragScrollSlot()) );#ifndef QT_NO_DRAGANDDROP    connect( &d->dndTimer, SIGNAL(timeout()),	     this, SLOT(doDrag()) );#endif    cursorPos = 0;    offset = 0;    maxLen = 32767;    cursorOn = TRUE;    markAnchor = 0;    markDrag = 0;    dragScrolling = FALSE;    scrollingLeft = FALSE;    tbuf = QString::fromLatin1("");    setFocusPolicy( StrongFocus );#ifndef QT_NO_CURSOR    setCursor( ibeamCursor );#endif    setBackgroundMode( PaletteBase );    setKeyCompression( TRUE );    alignmentFlag = Qt::AlignLeft;    setAcceptDrops( TRUE );    //   Specifies that this widget can use more, but is able to survive on    //   less, horizontal space; and is fixed vertically.    setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );    ed = FALSE;}/*!  Sets the line edit text to \e text, clears the selection and moves  the cursor to the end of the line.  If necessary the text is truncated to maxLength().  \sa text()*/void QLineEdit::setText( const QString &text ){#ifndef QT_NO_QWS_IM    forceIMEnd();#endif    QString oldText( tbuf );    tbuf = text;    if ( (int)tbuf.length() > maxLen )	tbuf.truncate( maxLen );    offset    = 0;    cursorPos = 0;    markAnchor = 0;    markDrag = 0;#ifdef QT_KEYPAD_MODE    // In keypad mode, we can show the start (most meaningful)    // since we go to the end as modal mode is entered.    if ( qt_modalEditingEnabled && !isModalEditing() )	home( FALSE );    else#endif	end( FALSE );#ifndef QT_NO_VALIDATOR    if ( validator() )	(void)validator()->validate( tbuf, cursorPos );#endif    d->pmDirty = TRUE;    update();    if ( d->undo ) {	d->undoList.clear();	d->redoList.clear();	d->needundo = TRUE;     }    if ( oldText != tbuf )	emit textChanged( tbuf );}/*!  Selects all text (i.e. marks it) and moves the cursor to the  end. This is useful when a default value has been inserted,  since if the user types before clicking on the widget the  selected text will be erased.*/void QLineEdit::selectAll(){    setSelection( 0, tbuf.length() );    end( TRUE );}/*!  Deselects all text (i.e. removes marking) and leaves the cursor at the  current position.*/void QLineEdit::deselect(){    setSelection( cursorPos, 0 );}/*!  Returns the text in the line.  \sa setText()*/QString QLineEdit::text() const{    return tbuf;}#if defined (_WS_QWS_)bool qt_lineedit_password_visible_on_focus = FALSE;#endif/*!  Returns the text that is displayed.  This is normallythe same as text(), but can be e.g. "*****" if EchoMode is Password or"" if it is NoEcho.\sa setEchoMode() text() EchoMode*/QString QLineEdit::displayText() const{    QString res;    switch( echoMode() ) {	case Normal:	    res = tbuf;	    break;	case NoEcho:	    res = QString::fromLatin1("");	    break;	case Password:	    res.fill( d->passwordChar, tbuf.length() );	    break;    }    return res;}/*!  Returns TRUE if part of the text has been marked by the user (e.g. by  clicking and dragging).  \sa markedText()*/bool QLineEdit::hasMarkedText() const{    return markAnchor != markDrag;}/*!  Returns the text marked by the user (e.g. by clicking and  dragging), or a \link QString::operator!() null string\endlink  if no text is marked.  \sa hasMarkedText()*/QString QLineEdit::markedText() const{    return tbuf.mid( minMark(), maxMark() - minMark() );}/*!  Returns the maximum permitted length of the text in the editor.  \sa setMaxLength()*/int QLineEdit::maxLength() const{    return maxLen;}/*!  Set the maximum length of the text in the editor.  If the text is  too long, it is chopped off at the limit. Any marked text will  be unmarked.	The cursor position is set to 0 and the first part of the  string is shown. \sa maxLength().*/void QLineEdit::setMaxLength( int m ){    maxLen = m;    markAnchor = 0;    markDrag = 0;    if ( (int)tbuf.length() > maxLen ) {	tbuf.truncate( maxLen );	d->pmDirty = TRUE;    }    setCursorPosition( 0 );    if ( d->pmDirty )	update();}/*!  \fn void  QLineEdit::returnPressed()  This signal is emitted when the return or enter key is pressed.*//*!  Converts a key press into a line edit action.  If return or enter is pressed and the current text is valid (or can be  \link QValidator::fixup() made valid\endlink by the validator),  the signal returnPressed is emitted.  The default key bindings are:  <ul>  <li><i> Left Arrow </i> Move the cursor one character leftwards.  <li><i> Right Arrow </i> Move the cursor one character rightwards.  <li><i> Backspace </i> Delete the character to the left of the cursor.  <li><i> Home </i> Move the cursor to the beginning of the line.  <li><i> End </i> Move the cursor to the end of the line.  <li><i> Delete </i> Delete the character to the right of the cursor.  <li><i> Shift - Left Arrow </i> Move and mark text one character leftwards.  <li><i> Shift - Right Arrow </i> Move and mark text one character rightwards.  <li><i> Control-A </i> Move the cursor to the beginning of the line.  <li><i> Control-B </i> Move the cursor one character leftwards.  <li><i> Control-C </i> Copy the marked text to the clipboard.  <li><i> Control-D </i> Delete the character to the right of the cursor.  <li><i> Control-E </i> Move the cursor to the end of the line.  <li><i> Control-F </i> Move the cursor one character rightwards.  <li><i> Control-H </i> Delete the character to the left of the cursor.  <li><i> Control-K </i> Delete to end of line  <li><i> Control-V </i> Paste the clipboard text into line edit.  <li><i> Control-X </i> Move the marked text to the clipboard.  <li><i> Control-Z </i> Undo the last operation.  <li><i> Control-Y </i> Redo the last undone operation.  </ul>  In addition, the following key bindings are used on Windows:  <ul>  <li><i> Shift - Delete </i> Cut the marked text, copy to clipboard  <li><i> Shift - Insert </i> Paste the clipboard text into line edit  <li><i> Control - Insert </i> Copy the marked text to the clipboard  </ul>  All other keys with valid ASCII codes insert themselves into the line.*/void QLineEdit::keyPressEvent( QKeyEvent *e ){#ifdef QT_KEYPAD_MODE    bool select = FALSE;    switch( e->key() ) {	case Key_Select:	    if( qt_modalEditingEnabled ) {		if ( isModalEditing() ) {		    setModalEditing( FALSE );		    select = TRUE;		}	    }	    break;	case Key_Back:	case Key_No:	    if ( !qt_modalEditingEnabled ||			    (qt_modalEditingEnabled && !isModalEditing()) ) {		e->ignore();		return;	    }	    break;	default:	    if( qt_modalEditingEnabled ) {		if ( !isModalEditing() && !(e->state() & ControlButton) ) {		    if ( e->text()[0].isPrint() ) {			setModalEditing( TRUE );			clear();		    } else {			e->ignore();			return;		    }		}	    }    }#endif#ifdef _WS_QWS_    if ( qt_lineedit_password_visible_on_focus &&	 echoMode() == Password &&#ifdef QT_KEYPAD_MODE	 e->key() != Key_Select &&#endif	 e->key() != Key_Up &&	 e->key() != Key_Down &&	 !isReadOnly() )    {	clear();	setEchoMode( Normal );	d->resumePassword = TRUE;    }#endif#ifdef QT_KEYPAD_MODE    if ( qt_modalEditingEnabled && !select && !isModalEditing() ) {	setModalEditing( TRUE );	if ( e->key() == Key_Select )	    return; // Just start. No action.    }#endif#ifdef QT_KEYPAD_MODE    select = e->key() == Key_Select;#endif    if ( e->key() == Key_Enter || e->key() == Key_Return#ifdef QT_KEYPAD_MODE	    || select#endif       )    {#ifdef QT_NO_VALIDATOR	emit returnPressed();	e->ignore();#else	const QValidator * v = validator();	if ( !v || v->validate( tbuf, cursorPos ) == QValidator::Acceptable ) {	    emit returnPressed();	    e->ignore();	}	else if ( v ) {	    QString old( tbuf );	    v->fixup( tbuf );	    if ( old != tbuf ) {		d->pmDirty = TRUE;		if ( cursorPos > (int)tbuf.length() )		    cursorPos = tbuf.length();		update();	    }	    if ( v->validate( tbuf, cursorPos ) == QValidator::Acceptable )		emit returnPressed();	    e->ignore();	}#endif	return;    }    if ( !d->readonly ) {	QString t = e->text();	if ( !t.isEmpty() && (!e->ascii() || e->ascii()>=32) &&	     e->key() != Key_Delete &&	     e->key() != Key_Backspace ) {	    insert( t );	    return;	}    }    bool needundo = d->needundo;    d->needundo = TRUE;    bool ignoreUndoWithDel = d->ignoreUndoWithDel;    d->ignoreUndoWithDel = FALSE;    int unknown = 0;    if ( e->state() & ControlButton ) {	switch ( e->key() ) {	case Key_A:	    home( e->state() & ShiftButton );	    break;	case Key_B:	    cursorLeft( e->state() & ShiftButton );	    break;#ifndef QT_NO_CLIPBOARD	case Key_C:	    copy();	    break;#endif	case Key_D:	    if ( !d->readonly ) {		d->ignoreUndoWithDel = ignoreUndoWithDel;		del();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕在线一区| 韩国成人精品a∨在线观看| 国产成人av一区二区三区在线| 91精品国产免费久久综合| 久久精品99国产精品日本| 日韩一区二区三区免费观看| 日本一区中文字幕 | 136国产福利精品导航| 99久久精品国产一区二区三区| 国产精品传媒视频| 欧美中文字幕一区二区三区| 免播放器亚洲一区| 欧美国产97人人爽人人喊| www.66久久| 亚洲小说春色综合另类电影| 日韩一区二区精品| 国产制服丝袜一区| 亚洲乱码中文字幕综合| 4438x成人网最大色成网站| 激情综合色播激情啊| 国产精品欧美经典| 51精品久久久久久久蜜臀| 成人午夜免费电影| 午夜精品一区在线观看| 精品不卡在线视频| 色综合久久综合| 激情综合色综合久久综合| 亚洲嫩草精品久久| 精品福利av导航| 欧美综合欧美视频| 国产精品77777竹菊影视小说| 亚洲少妇30p| 日韩欧美资源站| 色综合天天综合网国产成人综合天| 亚洲第一搞黄网站| 国产精品久线观看视频| 日韩欧美中文一区| 在线亚洲+欧美+日本专区| 国产传媒一区在线| 欧美96一区二区免费视频| 亚洲色图都市小说| 久久久午夜精品理论片中文字幕| 在线观看国产日韩| 成人黄色av网站在线| 国内久久精品视频| 日韩制服丝袜先锋影音| 亚洲欧洲精品一区二区三区| 欧美xxxx在线观看| 欧美蜜桃一区二区三区| 一本一道久久a久久精品综合蜜臀| 黑人巨大精品欧美黑白配亚洲| 亚洲精品一二三四区| 国产精品网站在线观看| 2020国产成人综合网| 91麻豆精品91久久久久同性| 91女厕偷拍女厕偷拍高清| 国产a级毛片一区| 国产在线精品一区二区不卡了| 午夜国产不卡在线观看视频| 亚洲乱码中文字幕| 亚洲图片欧美激情| 国产免费成人在线视频| 26uuu国产在线精品一区二区| 88在线观看91蜜桃国自产| 欧美在线不卡视频| 在线亚洲精品福利网址导航| 91一区二区三区在线观看| 岛国av在线一区| 国产成人综合视频| 国产精品香蕉一区二区三区| 久久99在线观看| 久久国内精品视频| 蜜臀av一区二区三区| 免费在线视频一区| 免费观看在线综合色| 免费xxxx性欧美18vr| 蜜臀精品久久久久久蜜臀 | 成人免费av网站| 丁香亚洲综合激情啪啪综合| 国产91丝袜在线播放九色| 国产精品1区2区| 成人av集中营| 91极品美女在线| 欧美伊人久久大香线蕉综合69| 欧美最猛黑人xxxxx猛交| 欧美视频在线一区| 555夜色666亚洲国产免| 欧美一级夜夜爽| 欧美精品一区二区三区高清aⅴ| 精品福利一区二区三区| 欧美国产激情二区三区| 国产精品福利在线播放| 亚洲欧美一区二区在线观看| 亚洲欧美视频一区| 亚洲国产另类精品专区| 青青草精品视频| 国产精品白丝jk黑袜喷水| 99这里只有久久精品视频| 日本韩国一区二区三区视频| 欧美日韩高清在线| 337p日本欧洲亚洲大胆精品| 亚洲国产精品t66y| 亚洲第一久久影院| 免费成人av资源网| 成人久久视频在线观看| 欧美日韩综合色| 精品少妇一区二区三区免费观看| 中文字幕 久热精品 视频在线| 亚洲欧美日韩国产手机在线| 日欧美一区二区| 国产乱一区二区| 欧美自拍偷拍一区| 久久综合久久鬼色中文字| 亚洲三级电影全部在线观看高清| 亚洲成人精品一区| 国内精品久久久久影院色| 欧美中文字幕一区| 久久久精品国产免大香伊| 亚洲摸摸操操av| 精品一区二区在线看| 一本在线高清不卡dvd| 欧美成人一区二区三区在线观看 | 亚洲激情自拍偷拍| 精品亚洲国内自在自线福利| 色综合久久88色综合天天免费| 欧美大胆人体bbbb| 一区二区三区四区乱视频| 国产在线一区观看| 欧美日韩三级一区二区| 中文字幕一区二区三区av| 久久国产精品72免费观看| 一本久道久久综合中文字幕| 精品av综合导航| 亚洲国产综合视频在线观看| 成人午夜视频免费看| 日韩欧美中文字幕公布| 亚洲国产一二三| 不卡一区二区中文字幕| 日韩精品综合一本久道在线视频| 日韩美女啊v在线免费观看| 国产精品18久久久久| 91精品免费在线观看| 亚洲综合视频在线| 成人美女在线视频| 久久久精品影视| 极品瑜伽女神91| 欧美一区二区在线免费观看| 亚洲精品成a人| 91美女在线视频| 中文无字幕一区二区三区| 韩国视频一区二区| 欧美一区二区三区啪啪| 亚洲无线码一区二区三区| 在线日韩av片| 亚洲区小说区图片区qvod| 粗大黑人巨茎大战欧美成人| 久久影院视频免费| 精品在线亚洲视频| 精品成人私密视频| 久久99国内精品| 欧美大片免费久久精品三p | 樱花草国产18久久久久| gogogo免费视频观看亚洲一| 亚洲国产精品精华液ab| 国产大陆精品国产| 欧美极品少妇xxxxⅹ高跟鞋| 国产成人精品免费网站| 精品999在线播放| 国产精品综合在线视频| 久久免费的精品国产v∧| 国产一区二区三区精品欧美日韩一区二区三区 | 日本韩国精品在线| 亚洲精品日韩综合观看成人91| 91一区二区在线观看| 亚洲天堂成人网| 日本丰满少妇一区二区三区| 一区二区三区四区在线播放| 欧美午夜精品理论片a级按摩| 亚洲一区在线观看视频| 777欧美精品| 精品一区二区三区不卡| 久久精品在线观看| av在线不卡观看免费观看| 亚洲猫色日本管| 欧美午夜一区二区| 日本午夜精品视频在线观看| 日韩无一区二区| 国产精品一区一区三区| 中文字幕视频一区二区三区久| 91视频在线观看免费| 一二三四区精品视频| 欧美一区二区三区日韩| 国产一区二区三区最好精华液| 久久精品日产第一区二区三区高清版| 国产 欧美在线| 亚洲电影第三页| 久久精品夜色噜噜亚洲a∨| 99久久精品免费精品国产| 亚洲国产三级在线| 26uuu色噜噜精品一区|