?? qlineedit.3qt
字號:
.SH "QString QLineEdit::selectedText () const"Returns the selected text. See the "selectedText" property for details..SH "void QLineEdit::selectionChanged ()\fC [signal]\fR"This signal is emitted whenever the selection changes..PPSee also hasSelectedText and selectedText..SH "int QLineEdit::selectionStart () const"selectionStart() returns the index of the first selected character in the line edit or -1 if no text is selected..PPSee also selectedText..SH "void QLineEdit::setAlignment ( int flag )\fC [virtual slot]\fR"Sets the alignment of the line edit to \fIflag\fR. See the "alignment" property for details..SH "void QLineEdit::setCursorPosition ( int )\fC [virtual slot]\fR"Sets the current cursor position for this line edit. See the "cursorPosition" property for details..SH "void QLineEdit::setDragEnabled ( bool b )\fC [virtual slot]\fR"Sets whether the lineedit starts a drag if the user presses and moves the mouse on some selected text to \fIb\fR. See the "dragEnabled" property for details..SH "void QLineEdit::setEchoMode ( EchoMode )\fC [virtual slot]\fR"Sets the line edit's echo mode. See the "echoMode" property for details..SH "void QLineEdit::setEdited ( bool )"Sets whether the line edit has been edited. Use modified instead. See the "edited" property for details..SH "void QLineEdit::setFrame ( bool )\fC [virtual slot]\fR"Sets whether the line edit draws itself with a frame. See the "frame" property for details..SH "void QLineEdit::setInputMask ( const QString & inputMask )"Sets the validation input mask to \fIinputMask\fR. See the "inputMask" property for details..SH "void QLineEdit::setMaxLength ( int )\fC [virtual slot]\fR"Sets the maximum permitted length of the text. See the "maxLength" property for details..SH "void QLineEdit::setReadOnly ( bool )\fC [virtual slot]\fR"Sets whether the line edit is read only. See the "readOnly" property for details..SH "void QLineEdit::setSelection ( int start, int length )\fC [virtual slot]\fR"Selects text from position \fIstart\fR and for \fIlength\fR characters..PPSee also deselect(), selectAll(), getSelection(), cursorForward(), and cursorBackward()..SH "void QLineEdit::setText ( const QString & )\fC [virtual slot]\fR"Sets the line edit's text. See the "text" property for details..SH "void QLineEdit::setValidator ( const QValidator * v )\fC [virtual slot]\fR"Sets this line edit to only accept input that the validator, \fIv\fR, will accept. This allows you to place any arbitrary constraints on the text which may be entered..PPIf \fIv\fR == 0, setValidator() removes the current input validator. The initial setting is to have no input validator (i.e. any input is accepted up to maxLength())..PPSee also validator(), QIntValidator, QDoubleValidator, and QRegExpValidator..PPExamples:.)l lineedits/lineedits.cpp and wizard/wizard.cpp..SH "QSize QLineEdit::sizeHint () const\fC [virtual]\fR"Returns a recommended size for the widget..PPThe width returned, in pixels, is usually enough for about 15 to 20 characters..PPExample: addressbook/centralwidget.cpp..SH "QString QLineEdit::text () const"Returns the line edit's text. See the "text" property for details..SH "void QLineEdit::textChanged ( const QString & )\fC [signal]\fR"This signal is emitted whenever the text changes. The argument is the new text..PPExamples:.)l simple/main.cpp, wizard/wizard.cpp, and xform/xform.cpp..SH "void QLineEdit::undo ()\fC [virtual slot]\fR"Undoes the last operation if undo is available. Deselects any current selection, and updates the selection start to the current cursor position..SH "bool QLineEdit::validateAndSet ( const QString & newText, int newPos, int newMarkAnchor, int newMarkDrag )"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. Use setText(), setCursorPosition() and setSelection() instead..SH "const QValidator * QLineEdit::validator () const"Returns a pointer to the current input validator, or 0 if no validator has been set..PPSee also setValidator()..PPExample: wizard/wizard.cpp..SS "Property Documentation".SH "bool acceptableInput"This property holds whether the input satisfies the inputMask and the validator..PPGet this property's value with hasAcceptableInput()..PPSee also inputMask and setValidator()..SH "Alignment alignment"This property holds the alignment of the line edit..PPPossible Values are Qt::AlignAuto, Qt::AlignLeft, Qt::AlignRight and Qt::AlignHCenter..PPAttempting to set the alignment to an illegal flag combination does nothing..PPSee also Qt::AlignmentFlags..PPSet this property's value with setAlignment() and get this property's value with alignment()..SH "int cursorPosition"This property holds the current cursor position for this line edit..PPSetting the cursor position causes a repaint when appropriate..PPSet this property's value with setCursorPosition() and get this property's value with cursorPosition()..SH "QString displayText"This property holds the displayed text..PPIf EchoMode is Normal this returns the same as text(); if EchoMode is Password it returns a string of asterisks text().length() characters long, e.g. "******"; if EchoMode is NoEcho returns an empty string, ""..PPSee also echoMode, text, and EchoMode..PPGet this property's value with displayText()..SH "bool dragEnabled"This property holds whether the lineedit starts a drag if the user presses and moves the mouse on some selected text..PPSet this property's value with setDragEnabled() and get this property's value with dragEnabled()..SH "EchoMode echoMode"This property holds the line edit's echo mode..PPThe initial setting is Normal, but QLineEdit also supports NoEcho and Password modes..PPThe widget's display and the ability to copy or drag the text is affected by this setting..PPSee also EchoMode and displayText..PPSet this property's value with setEchoMode() and get this property's value with echoMode()..SH "bool edited"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPThis property holds whether the line edit has been edited. Use modified instead..PPSet this property's value with setEdited() and get this property's value with edited()..SH "bool frame"This property holds whether the line edit draws itself with a frame..PPIf enabled (the default) the line edit draws itself inside a two-pixel frame, otherwise the line edit draws itself without any frame..PPSet this property's value with setFrame() and get this property's value with frame()..SH "bool hasMarkedText"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPThis property holds whether part of the text has been selected by the user. Use hasSelectedText instead..PPGet this property's value with hasMarkedText()..SH "bool hasSelectedText"This property holds whether there is any text selected..PPhasSelectedText() returns TRUE if some or all of the text has been selected by the user; otherwise returns FALSE..PPSee also selectedText..PPGet this property's value with hasSelectedText()..SH "QString inputMask"This property holds the validation input mask..PPIf no mask is set, inputMask() returns QString::null..PPSets the QLineEdit's validation mask. Validators can be used instead of, or in conjunction with masks; see setValidator()..PPUnset the mask and return to normal QLineEdit operation by passing an empty string ("") or just calling setInputMask() with no arguments..PPThe mask format understands these mask characters: <center>.nf.TSl - l. Character Meaning ASCII alphabetic character required. A-Z, a-z. ASCII alphabetic character permitted but not required. ASCII alphanumeric character required. A-Z, a-z, 0-9. ASCII alphanumeric character permitted but not required. Any character required. x Any character permitted but not required. ASCII digit required. 0-9. ASCII digit permitted but not required. ASCII digit required. 1-9. ASCII digit permitted but not required (1-9). ASCII digit or plus/minus sign permitted but not required. All following alphabetic characters are uppercased. All following alphabetic characters are lowercased. Switch off case conversion. Use.TE.fi</center>.PPThe mask consists of a string of mask characters and separators, optionally followed by a semi-colon and the character used for blanks: the blank characters are always removed from the text after editing. The default blank character is space..PPExamples:.)l<center>.nf.TSl - l. Mask Notes IP address; blanks are ISO Date; blanks are License number; blanks are.TE.fi</center>.PPTo get range control (e.g. for an IP address) use masks together with validators..PPSee also maxLength..PPSet this property's value with setInputMask() and get this property's value with inputMask()..SH "QString markedText"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPThis property holds the text selected by the user. Use selectedText instead..PPGet this property's value with markedText()..SH "int maxLength"This property holds the maximum permitted length of the text..PPIf the text is too long, it is truncated at the limit..PPIf truncation occurs any selected text will be unselected, the cursor position is set to 0 and the first part of the string is shown..PPIf the line edit has an input mask, the mask defines the maximum string length..PPSee also inputMask..PPSet this property's value with setMaxLength() and get this property's value with maxLength()..SH "bool modified"This property holds whether the line edit's contents has been modified by the user..PPThe modified flag is never read by QLineEdit; it has a default value of FALSE and is changed to TRUE whenever the user changes the line edit's contents..PPThis is useful for things that need to provide a default value but do not start out knowing what the default should be (perhaps it depends on other fields on the form). Start the line edit without the best default, and when the default is known, if modified() returns FALSE (the user hasn't entered any text), insert the default value..PPCalling clearModified() or setText() resets the modified flag to FALSE..PPGet this property's value with isModified()..SH "bool readOnly"This property holds whether the line edit is read only..PPIn read-only mode, the user can still copy the text to the clipboard or drag-and-drop the text (if echoMode() is Normal), but cannot edit it..PPQLineEdit does not show a cursor in read-only mode..PPSee also enabled..PPSet this property's value with setReadOnly() and get this property's value with isReadOnly()..SH "bool redoAvailable"This property holds whether redo is available..PPGet this property's value with isRedoAvailable()..SH "QString selectedText"This property holds the selected text..PPIf there is no selected text this property's value is QString::null..PPSee also hasSelectedText..PPGet this property's value with selectedText()..SH "QString text"This property holds the line edit's text..PPSetting this property clears the selection, clears the undo/redo history, moves the cursor to the end of the line and resets the modified property to FALSE. The text is not validated when inserted with setText()..PPThe text is truncated to maxLength() length..PPSee also insert()..PPSet this property's value with setText() and get this property's value with text()..SH "bool undoAvailable"This property holds whether undo is available..PPGet this property's value with isUndoAvailable()..SH "SEE ALSO".BR http://doc.trolltech.com/qlineedit.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 (qlineedit.3qt) and the Qtversion (3.3.4).
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -