⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qintvalidator.3qt

📁 qt专门用于嵌入式的图形开发GUI
💻 3QT
字号:
'\" t.TH QIntValidator 3qt "2 September 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQIntValidator \- Validator which ensures that a string contains a valid integer within a specified range.SH SYNOPSIS\fC#include <qvalidator.h>\fR.PPInherits QValidator..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQIntValidator\fR ( QObject * parent, const char * name = 0 )".br.ti -1c.BI "\fBQIntValidator\fR ( int minimum, int maximum, QObject * parent, const char * name = 0 )".br.ti -1c.BI "\fB~QIntValidator\fR ()".br.ti -1c.BI "virtual QValidator::State \fBvalidate\fR ( QString & input, int & ) const".br.ti -1c.BI "void \fBsetBottom\fR ( int )".br.ti -1c.BI "void \fBsetTop\fR ( int )".br.ti -1c.BI "virtual void \fBsetRange\fR ( int bottom, int top )".br.ti -1c.BI "int \fBbottom\fR () const".br.ti -1c.BI "int \fBtop\fR () const".br.in -1c.SS "Properties".in +1c.ti -1c.BI "int \fBbottom\fR - the validator's lowest acceptable value".br.ti -1c.BI "int \fBtop\fR - the validator's highest acceptable value".br.in -1c.SH DESCRIPTIONThe QIntValidator class provides a validator which ensures that a string contains a valid integer within a specified range..PPExample of use:.PP.nf.br    QValidator* validator = new QIntValidator( 100, 999, this );.br    QLineEdit* edit = new QLineEdit( this );.br.br    // the edit lineedit will only accept integers between 100 and 999.br    edit->setValidator( validator );.br.fi.PPBelow we present some examples of validators. In practice they would normally be associated with a widget as in the example above..PP.nf.br    QString str;.br    int pos = 0;.br    QIntValidator v( 100, 999, this );.br.br    str = "1";.br    v.validate( str, pos );     // returns Intermediate.br    str = "12";.br    v.validate( str, pos );     // returns Intermediate.br.br    str = "123";.br    v.validate( str, pos );     // returns Acceptable.br    str = "678";.br    v.validate( str, pos );     // returns Acceptable.br.br    str = "1234";.br    v.validate( str, pos );     // returns Invalid.br    str = "-123";.br    v.validate( str, pos );     // returns Invalid.br    str = "abc";.br    v.validate( str, pos );     // returns Invalid.br    str = "12cm";.br    v.validate( str, pos );     // returns Invalid.br.fi.PPThe minimum and maximum values are set in one call with setRange() or individually with setBottom() and setTop()..PPSee also QDoubleValidator, QRegExpValidator, and Miscellaneous Classes..SH MEMBER FUNCTION DOCUMENTATION.SH "QIntValidator::QIntValidator ( QObject * parent, const char * name = 0 )"Constructs a validator called \fIname\fR with parent \fIparent\fR, that accepts all integers..SH "QIntValidator::QIntValidator ( int minimum, int maximum, QObject * parent, const char * name = 0 )"Constructs a validator called \fIname\fR with parent \fIparent\fR, that accepts integers from \fIminimum\fR to \fImaximum\fR inclusive..SH "QIntValidator::~QIntValidator ()"Destroys the validator, freeing any resources allocated..SH "int QIntValidator::bottom () const"Returns the validator's lowest acceptable value. See the "bottom" property for details..SH "void QIntValidator::setBottom ( int )"Sets the validator's lowest acceptable value. See the "bottom" property for details..SH "void QIntValidator::setRange ( int bottom, int top )\fC [virtual]\fR"Sets the range of the validator to only accept integers between \fIbottom\fR and \fItop\fR inclusive..SH "void QIntValidator::setTop ( int )"Sets the validator's highest acceptable value. See the "top" property for details..SH "int QIntValidator::top () const"Returns the validator's highest acceptable value. See the "top" property for details..SH "QValidator::State QIntValidator::validate ( QString & input, int & ) const\fC [virtual]\fR"Returns Acceptable if the \fIinput\fR is an integer within the valid range, Intermediate if the \fIinput\fR is an integer outside the valid range and Invalid if the \fIinput\fR is not an integer..PPNote: If the valid range consists of just positive integers (e.g. 32 - 100) and \fIinput\fR is a negative integer then Invalid is returned..PP.nf.br    int pos = 0;.br    s = "abc";.br    v.validate( s, pos ); // returns Invalid.br.br    s = "5";.br    v.validate( s, pos ); // returns Intermediate.br.br    s = "50";.br    v.validate( s, pos ); // returns Valid.br.fi.PPReimplemented from QValidator..SS "Property Documentation".SH "int bottom"This property holds the validator's lowest acceptable value..PPSet this property's value with setBottom() and get this property's value with bottom()..PPSee also setRange()..SH "int top"This property holds the validator's highest acceptable value..PPSet this property's value with setTop() and get this property's value with top()..PPSee also setRange()..SH "SEE ALSO".BR http://doc.trolltech.com/qintvalidator.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qintvalidator.3qt) and the Qtversion (3.3.5).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -