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

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

?? qvalidator.cpp

?? qtopia-phone-2.2.0下公共的控件實現源代碼。
?? CPP
字號:
/****************************************************************************** $Id: qt/src/widgets/qvalidator.cpp   2.3.12   edited 2005-10-27 $**** Implementation of validator classes.**** Created : 970610**** 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 "qvalidator.h"#ifndef QT_NO_VALIDATOR#include "qwidget.h"#include "qregexp.h"#include <math.h> // HUGE_VAL#include <limits.h> // *_MIN, *_MAX#include <ctype.h> // isdigit// NOT REVISED/*!  \class QValidator qvalidator.h  \brief The QValidator class provides validation of input text.  \ingroup misc  The class itself is abstract; two subclasses provide rudimentary  numeric range checking.  The class includes two virtual functions, validate() and fixup().  validate() is pure virtual, so it must be implemented by every  subclass.  It returns \c Invalid, \c Intermediate or \c Acceptable  depending on whether its argument is valid (for the class'  definition of valid).  The three states require some explanation.  An \c Invalid string is  \e clearly invalid.  \c Intermediate is less obvious - the concept  of validity is slippery when the string is incomplete (still being  edited).  QValidator defines \c Intermediate as the property of a  string that it is neither clearly invalid or acceptable as a final  result.  \c Acceptable means that the string is acceptable as a  final result.  One might say that any string that is a plausible  intermediate state during entry of an \c Acceptable string is \c  Intermediate.  Here are some examples:  <ol>  <li>For a line edit that accepts integers from 0 to 999 inclusive,  42 and 666 are \c Acceptable, the empty string and 1114 are \c  Intermediate and asdf is \c Invalid.  <li>For an editable combo box that accepts URLs, any well-formed URL  is \c Acceptable, "http://www.trolltech.com/," is \c Intermediate (it can  be a cut-and-paste job that accidentally took in a comma at the  end), the empty string is valid (the user might select and delete  all of the text in preparation to entering a new URL), and  "http:///./" is \c Invalid.  <li>For a spin box that accepts lengths, "11cm" and "1in" are \c  Acceptable, "11" and the empty string are \c Intermediate, and  "http://www.trolltech.com" and "hour" are \c Invalid.  </ol>  fixup() is provided for validators that can repair some or all user  errors.  The default does nothing.  QLineEdit, for example, will  call fixup() if the user presses Return and the content is not  currently valid, in case fixup() can do magic.  This allows some \c  Invalid strings to be made \c Acceptable, too, spoiling the muddy  definition above even more.  QValidator is generally used with QLineEdit, QSpinBox and QComboBox.*//*! \enum QValidator::State  This enum type defines the states in which a validated string can  be.  There are currently three states: <ul>  <li> \c Invalid - the string is \e clearly invalid.  <li> \c Intermediate - the string is a plausible intermediate value  during editing.  <li> \c Acceptable - acceptable as a final result.  </ul>  The state \c Valid has been renamed \c Intermediate.  The old name  confused too many people and is now obsolete.*//*!  Sets up the internal data structures used by the validator.  At  the moment there aren't any.*/QValidator::QValidator( QWidget * parent, const char *name )    : QObject( parent, name ){}/*!  Destroys the validator, freeing any storage and other resources  used.*/QValidator::~QValidator(){}/*!  \fn QValidator::State QValidator::validate( QString& input, int& pos ) const  This pure virtual function returns \c Invalid if \a input is invalid  according to this validator's rules, \c Intermediate if it is likely that a  little more editing will make the input acceptable (e.g. the user  types '4' into a widget which accepts 10-99) and \c Acceptable if  the input is completely acceptable.  The function can change \a input and \a pos (the cursor position) if  it wants to.*//*!  \fn void QValidator::fixup( QString & input ) const  Attempts to change \a input to be valid according to this validator's  rules.  Need not result in a valid string - callers of this function  must re-test afterwards.  The default does nothing.  Reimplementations of this function can change \a input even if they  do not produce a valid string.  For example an ISBN validator might  want to delete every character except digits and "-", even if the  result is not a valid ISBN, and a last-name validator might want to  remove white space from the start and end of the string, even if the  resulting string is not in the list of known last names.*/void QValidator::fixup( QString & ) const{}/*!  \class QIntValidator qvalidator.h  \brief The QIntValidator class provides range checking of integers.  \ingroup misc  QIntValidator provides a lower and an upper bound.  It does not  provide a fixup() function.  \sa QDoubleValidator*//*!  Constructs a validator object which accepts all integers.*/QIntValidator::QIntValidator( QWidget * parent, const char *name )    : QValidator( parent, name ){    b = INT_MIN;    t = INT_MAX;}/*!  Constructs a validator object which accepts all integers from \a  bottom up to and including \a top.*/QIntValidator::QIntValidator( int bottom, int top,			      QWidget * parent, const char* name )    : QValidator( parent, name ){    b = bottom;    t = top;}/*!  Destroys the validator, freeing any storage and other resources  used.*/QIntValidator::~QIntValidator(){    // nothing}/*!  Returns \a Acceptable if \a input contains a number in the legal  range, \a Intermediate if it contains another integer or is empty,  and \a Invalid if \a input is not an integer.*/QValidator::State QIntValidator::validate( QString & input, int & ) const{    QRegExp empty( QString::fromLatin1("^ *-? *$") );    if ( empty.match( input ) >= 0 )	return QValidator::Intermediate;    bool ok;    long int tmp = input.toLong( &ok );    if ( !ok )	return QValidator::Invalid;    else if ( tmp < b || tmp > t )	return QValidator::Intermediate;    else	return QValidator::Acceptable;}/*!  Sets the validator to accept only number from \a bottom up to an  including \a top.*/void QIntValidator::setRange( int bottom, int top ){    b = bottom;    t = top;}/*!  Sets the validator to accept no numbers smaller than \a bottom.  \sa setRange()*/void QIntValidator::setBottom( int bottom ){    setRange( bottom, top() );}/*!  Sets the validator to accept no numbers bigger than \a top.  \sa setRange()*/void QIntValidator::setTop( int top ){    setRange( bottom(), top );}/*!  \fn int QIntValidator::bottom() const  Returns the lowest valid number according to this validator.  \sa top() setRange()*//*!  \fn int QIntValidator::top() const  Returns the highest valid number according to this validator.  \sa bottom() setRange()*//*!  \class QDoubleValidator qvalidator.h  \brief The QDoubleValidator class provides range checking of  floating-point numbers.  \ingroup misc  QDoubleValidator provides an upper bound, a lower bound, and a limit  on the number of digits after the decimal point.  It does not  provide a fixup() function.  \sa QIntValidator*//*!  Constructs a validator object which accepts all doubles.*/QDoubleValidator::QDoubleValidator( QWidget * parent, const char *name )    : QValidator( parent, name ){    b = -HUGE_VAL;    t = HUGE_VAL;    d = 1000;}/*!  Constructs a validator object which accepts all doubles from \a  bottom up to and including \a top with at most \a decimals digits  after the decimal point.*/QDoubleValidator::QDoubleValidator( double bottom, double top, int decimals,				    QWidget * parent, const char* name )    : QValidator( parent, name ){    b = bottom;    t = top;    d = decimals;}/*!  Destroys the validator, freeing any storage and other resources  used.*/QDoubleValidator::~QDoubleValidator(){    // nothing}/*!  Returns \a Acceptable if \a input contains a number in the legal  range and format, \a Intermediate if it contains another number, a  number with too many digits after the decimal point or is empty, and  \a Invalid if \a input is not a number.*/QValidator::State QDoubleValidator::validate( QString & input, int & ) const{    QRegExp empty( QString::fromLatin1("^ *-?\\.? *$") );    if ( empty.match( input ) >= 0 )	return QValidator::Intermediate;    bool ok = TRUE;    double tmp = input.toDouble( &ok );    if ( !ok ) {	QRegExp expexpexp( QString::fromLatin1("e-?\\d*$"), FALSE );	int eeePos = expexpexp.match( input ); // EXPlicit EXPonent regEXP!	int nume = input.contains( 'e', FALSE );	if ( eeePos > 0 && nume < 2 ) {	    QString mantissa = input.left( eeePos );	    tmp = mantissa.toDouble( &ok );	    if ( !ok )		return QValidator::Invalid;	}	else if ( eeePos == 0 ) {	    return QValidator::Intermediate;	}	else {	    return QValidator::Invalid;	}    }    int i = input.find( '.' );    if ( i >= 0 ) {	// has decimal point, now count digits after that	i++;	int j = i;	while( input[j].isDigit() )	    j++;	if ( j - i > d )	    return QValidator::Intermediate;    }    if ( tmp < b || tmp > t )	return QValidator::Intermediate;    else	return QValidator::Acceptable;}/*!  Sets the validator to accept numbers from \a bottom up to and  including \a top with at most \a decimals digits after the decimal  point.*/void QDoubleValidator::setRange( double bottom, double top, int decimals ){    b = bottom;    t = top;    d = decimals;}/*!  Sets the validator to accept no numbers smaller than \a bottom.  \sa setRange()*/void QDoubleValidator::setBottom( double bottom ){    setRange( bottom, top(), decimals() );}/*!  Sets the validator to accept no numbers bigger than \a top.  \sa setRange()*/void QDoubleValidator::setTop( double top ){    setRange( bottom(), top, decimals() );}/*!  Sets the maximum number of digits after the decimal point.*/void QDoubleValidator::setDecimals( int decimals ){    setRange( bottom(), top(), decimals );}/*!  \fn double QDoubleValidator::bottom() const  Returns the lowest valid number according to this validator.  \sa top() decimals() setRange()*//*!  \fn double QDoubleValidator::top() const  Returns the highest valid number according to this validator.  \sa bottom() decimals() setRange()*//*!  \fn int QDoubleValidator::decimals() const  Returns the largest number of digits a valid number can have after  its decimal point.  \sa bottom() top() setRange()*/#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜免费av| av中文字幕不卡| 国产婷婷色一区二区三区| 中文字幕中文在线不卡住| 欧美日韩免费电影| 欧美日韩高清不卡| 中文字幕色av一区二区三区| 男女性色大片免费观看一区二区| 成人一级片在线观看| 精品久久一区二区三区| 亚洲bt欧美bt精品| 色噜噜狠狠成人网p站| 久久久99精品免费观看| 日本欧美一区二区三区乱码| 欧美日韩日日夜夜| 自拍偷拍亚洲综合| 99这里都是精品| 国产欧美中文在线| 国产精品综合一区二区| 欧美成人精品高清在线播放| 午夜精品福利一区二区三区蜜桃| 99久久精品免费看| 国产成人av自拍| 国产精品久久久久桃色tv| 国产精品美女一区二区三区| 国产福利电影一区二区三区| 2017欧美狠狠色| 国产剧情一区二区三区| 久久色.com| 精品一二线国产| 精品国一区二区三区| 亚洲成人免费影院| 国产乱码精品一品二品| 欧美日韩一二区| 一区二区三区影院| 色诱视频网站一区| 亚洲第一主播视频| 欧美一级精品大片| 精品在线亚洲视频| 精品成a人在线观看| 精品一区二区三区av| 精品国产成人在线影院| 粉嫩13p一区二区三区| 亚洲三级在线播放| 欧美精品色一区二区三区| 免费在线看一区| 久久久亚洲午夜电影| 成年人国产精品| 亚洲成人午夜影院| 精品成人私密视频| 色综合色综合色综合| 日韩国产欧美在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 国产91对白在线观看九色| 亚洲蜜臀av乱码久久精品| 3d成人动漫网站| 国产成人精品三级麻豆| 亚洲一区影音先锋| 久久先锋影音av鲁色资源网| 99久久精品国产一区| 日韩精品欧美成人高清一区二区| 久久日韩精品一区二区五区| 色综合久久天天| 裸体歌舞表演一区二区| 国产精品欧美精品| 国产精品一区二区在线看| 亚洲综合久久av| av电影一区二区| 婷婷成人激情在线网| 国产午夜精品福利| 欧美主播一区二区三区美女| 精品一区二区三区蜜桃| 亚洲美腿欧美偷拍| 久久精品夜色噜噜亚洲aⅴ| 91国在线观看| 风间由美一区二区三区在线观看 | 国产午夜精品一区二区三区嫩草 | 92精品国产成人观看免费| 日韩中文字幕区一区有砖一区| 久久久久高清精品| 欧美日韩国产影片| av电影天堂一区二区在线观看| 日韩制服丝袜av| 亚洲精品国产成人久久av盗摄| 日韩精品一区二区三区视频播放| 91免费小视频| 成人听书哪个软件好| 蜜芽一区二区三区| 亚洲成人精品影院| 亚洲精品中文在线观看| 国产精品久久久久久福利一牛影视 | 久久久久久久久久久久久夜| 555www色欧美视频| 欧美体内she精高潮| 成人在线一区二区三区| 国产在线精品一区二区| 免费观看在线综合色| 亚洲成人你懂的| 亚洲综合色在线| 亚洲激情自拍视频| 最新日韩在线视频| 亚洲欧美综合另类在线卡通| 国产色婷婷亚洲99精品小说| 精品盗摄一区二区三区| 精品88久久久久88久久久| 日韩视频一区在线观看| 欧美一区二区三区男人的天堂| 精品视频在线看| 欧美日韩高清影院| 制服丝袜亚洲色图| 91精品久久久久久蜜臀| 欧美一区二区三区四区久久| 91精品国产综合久久久蜜臀图片 | 免费成人av资源网| 免费高清在线一区| 精品无人区卡一卡二卡三乱码免费卡| 五月开心婷婷久久| 另类小说色综合网站| 蜜桃av噜噜一区| 国产一区在线看| av高清不卡在线| 欧美专区在线观看一区| 555夜色666亚洲国产免| 日韩精品中文字幕一区| 久久久99久久| 亚洲视频一区二区在线观看| 亚洲一区二区三区美女| 午夜精品久久久久久久99水蜜桃 | 成人午夜私人影院| 色婷婷综合在线| 欧美精三区欧美精三区| 日韩久久精品一区| 国产精品嫩草影院av蜜臀| 亚洲三级在线观看| 婷婷一区二区三区| 国精品**一区二区三区在线蜜桃| 国产成人在线影院| 在线视频综合导航| 欧美变态凌虐bdsm| 日本一区二区高清| 亚洲一区在线播放| 韩国三级电影一区二区| 色偷偷88欧美精品久久久| 91精品国产综合久久小美女| 久久久一区二区三区| 樱花草国产18久久久久| 另类人妖一区二区av| av电影在线观看完整版一区二区| 欧美日韩大陆一区二区| 国产三级精品在线| 午夜久久久久久电影| 粉嫩av亚洲一区二区图片| 欧美日本在线一区| 久久精品欧美一区二区三区麻豆| 亚洲一区二区三区四区在线观看| 久久97超碰色| 欧美日韩一级黄| 国产精品私人自拍| 免费高清不卡av| 在线观看亚洲a| 国产精品嫩草99a| 日本一区中文字幕| 91原创在线视频| 国产色婷婷亚洲99精品小说| 亚洲成av人片一区二区梦乃 | 91精品久久久久久蜜臀| 中文字幕一区二区不卡| 韩国毛片一区二区三区| 欧美精品三级在线观看| 亚洲精品亚洲人成人网在线播放| 精品制服美女丁香| 8x8x8国产精品| 亚洲自拍偷拍网站| 成人av网址在线| 国产日韩av一区| 激情综合五月婷婷| 欧美一级生活片| 亚洲va中文字幕| 欧美手机在线视频| 一区二区视频在线| 成人app软件下载大全免费| 久久午夜国产精品| 麻豆91在线播放| 日韩欧美高清dvd碟片| 人人精品人人爱| 欧美精品在线一区二区三区| 亚洲午夜免费视频| 在线一区二区观看| 一区二区三区av电影 | 欧美成人精品1314www| 午夜精品福利一区二区三区蜜桃| 欧洲中文字幕精品| 亚洲一区二区三区精品在线| 91福利视频在线| 亚洲一区二区成人在线观看| 色狠狠一区二区三区香蕉| 一区二区三区在线观看视频| 91毛片在线观看| 亚洲综合色噜噜狠狠| 欧美综合亚洲图片综合区|