?? qlineedit.3qt
字號(hào):
Copies the marked text to the clipboard and deletes it, if there is any..PPIf the current validator disallows deleting the marked text, cut() will copy it but not delete it..PPSee also copy() and paste()..SH "void QLineEdit::del ()"Deletes the character on the right side of the text cursor. If a text has been marked by the user (e.g. by clicking and dragging) the cursor will be put at the beginning of the marked text and the marked text will be removed..PPSee also backspace()..SH "void QLineEdit::deselect () \fC[slot]\fR"Deselects all text (i.e. removes marking) and leaves the cursor at the current position..SH "QString QLineEdit::displayText () const"Returns the text that is displayed. This is normally the same as text(), but can be e.g. "*****" if EchoMode is Password or" " if it is NoEcho..PPSee also setEchoMode(), text() and EchoMode..SH "void QLineEdit::dragEnterEvent ( QDragEnterEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::dropEvent ( QDropEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QLineEdit::EchoMode QLineEdit::echoMode() const"Returns the echo mode of the line edit..PPSee also setEchoMode() and EchoMode..SH "bool QLineEdit::edited () const"Returns the edited flag of the line edit. If this returns FALSE, the line edit's contents have not been changed since the construction of the QLineEdit (or the last call to either setText() or setEdited( FALSE ), if any). If it returns true, the contents have been edited, or setEdited( TRUE ) has been called..PPSee also setEdited()..SH "void QLineEdit::end ( bool mark )"Moves the text cursor to the right end of the line. If mark is TRUE text will be marked towards the last position, if not any marked text will be unmarked if the cursor is moved..PPSee also home()..SH "bool QLineEdit::event ( QEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QObject..SH "void QLineEdit::focusInEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::focusOutEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "bool QLineEdit::frame () const"Returns TRUE if the line edit draws itself inside a frame, FALSE if it draws itself without any frame..PPThe default is to use a frame..PPSee also setFrame()..SH "bool QLineEdit::hasMarkedText () const"Returns TRUE if part of the text has been marked by the user (e.g. by clicking and dragging)..PPSee also markedText()..SH "void QLineEdit::home ( bool mark )"Moves the text cursor to the left end of the line. If mark is TRUE text will be marked towards the first position, if not any marked text will be unmarked if the cursor is moved..PPSee also end()..SH "void QLineEdit::insert ( const QString & newText ) \fC[slot]\fR"Removes any selected text, inserts \fInewText,\fR validates the result and if it is valid, sets it as the new contents of the line edit..SH "bool QLineEdit::isReadOnly () const"Returns whether the line-edit is read-only..PPSee also setReadOnly()..SH "void QLineEdit::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Converts a key press into a line edit action..PPIf return or enter is pressed and the current text is valid (or can be made valid by the validator), the signal returnPressed is emitted..PPThe default key bindings are:.TP\fI Left Arrow \fR Move the cursor one character leftwards..TP\fI Right Arrow \fR Move the cursor one character rightwards..TP\fI Backspace \fR Delete the character to the left of the cursor..TP\fI Home \fR Move the cursor to the beginning of the line..TP\fI End \fR Move the cursor to the end of the line..TP\fI Delete \fR Delete the character to the right of the cursor..TP\fI Shift - Left Arrow \fR Move and mark text one character leftwards..TP\fI Shift - Right Arrow \fR Move and mark text one character rightwards..TP\fI Control-A \fR Move the cursor to the beginning of the line..TP\fI Control-B \fR Move the cursor one character leftwards..TP\fI Control-C \fR Copy the marked text to the clipboard..TP\fI Control-D \fR Delete the character to the right of the cursor..TP\fI Control-E \fR Move the cursor to the end of the line..TP\fI Control-F \fR Move the cursor one character rightwards..TP\fI Control-H \fR Delete the character to the left of the cursor..TP\fI Control-K \fR Delete to end of line.TP\fI Control-V \fR Paste the clipboard text into line edit..TP\fI Control-X \fR Move the marked text to the clipboard..TP\fI Control-Z \fR Undo the last operation..TP\fI Control-Y \fR Redo the last undone operation. In addition, the following key bindings are used on Windows:.TP\fI Shift - Delete \fR Cut the marked text, copy to clipboard.TP\fI Shift - Insert \fR Paste the clipboard text into line edit.TP\fI Control - Insert \fR Copy the marked text to the clipboard.PPAll other keys with valid ASCII codes insert themselves into the line..PPReimplemented from QWidget..SH "void QLineEdit::leaveEvent ( QEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QString QLineEdit::markedText () const"Returns the text marked by the user (e.g. by clicking and dragging), or a null string if no text is marked..PPSee also hasMarkedText()..SH "int QLineEdit::maxLength () const"Returns the maximum permitted length of the text in the editor..PPSee also setMaxLength()..SH "QSize QLineEdit::minimumSizeHint () const \fC[virtual]\fR"Returns a minimum size for the line edit..PPThe width returned is enough for at least one character..PPReimplemented from QWidget..SH "void QLineEdit::mouseDoubleClickEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::paintEvent ( QPaintEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::paste ()"Inserts the clipboard's text at the cursor position, deleting any previous marked text..PPIf the end result is not acceptable for the current validator, nothing happens..PPSee also copy() and cut()..SH "void QLineEdit::repaintArea ( int from, int to ) \fC[protected]\fR"Repaints all characters from \fIfrom\fR to \fIto.\fR If cursorPos is between from and to, ensures that cursorPos is visible..SH "void QLineEdit::resizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QLineEdit::returnPressed () \fC[signal]\fR"This signal is emitted when the return or enter key is pressed..SH "void QLineEdit::selectAll () \fC[slot]\fR"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..SH "void QLineEdit::setAlignment ( int flag )"Sets the alignment of the line edit. Possible Values are Qt::AlignLeft, Qt::AlignRight and Qt::Align(H)Center - see Qt::AlignmentFlags..PPSee also alignment()..SH "void QLineEdit::setCursorPosition ( int newPos ) \fC[virtual]\fR"Sets the cursor position for this line edit to \fInewPos\fR and repaints accordingly..PPSee also cursorPosition()..SH "void QLineEdit::setEchoMode ( EchoMode mode )"Sets the echo mode of the line edit widget..PPThe echo modes available are:.TP\fCNormal\fR - display characters as they are entered. This is the default..TP\fCNoEcho\fR - do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret..TP\fCPassword\fR - display asterisks instead of the characters actually entered..PPThe widget's display, and the ability to copy or drag the text is affected by this setting..PPSee also echoMode(), EchoMode and displayText()..SH "void QLineEdit::setEdited ( bool on )"Sets the edited flag of this line edit to \fIon.\fR The edited flag is never read by QLineEdit, and is changed to TRUE whenever the user changes its contents..PPThis is useful e.g. for things that need to provide a default value, but cannot find the default at once. Just open the line edit without the best default and when the default is known, check the edited() return value and set the line edit's contents if the user has not started editing the line edit..PPSee also edited()..SH "void QLineEdit::setEnabled ( bool e ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QLineEdit::setFont ( const QFont & f ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QLineEdit::setFrame ( bool enable ) \fC[virtual]\fR"Sets the line edit to draw itself inside a frame if \fIenable\fR is TRUE, and to draw itself without any frame if \fIenable\fR is FALSE..PPThe default is TRUE..PPSee also frame()..SH "void QLineEdit::setMaxLength ( int m ) \fC[virtual]\fR"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..PPSee also maxLength()..SH "void QLineEdit::setPalette ( const QPalette & p ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..SH "void QLineEdit::setReadOnly ( bool enable )"Enables or disables read-only mode, where the user can cut-and-paste or drag-and-drop the text, but cannot edit it. They never see a cursor in this case..PPSee also setEnabled() and isReadOnly()..SH "void QLineEdit::setSelection ( int start, int length ) \fC[virtual]\fR"Sets the marked area of this line edit to start at \fIstart\fR and be \fIlength\fR characters long..SH "void QLineEdit::setText ( const QString & text ) \fC[virtual slot]\fR"Sets the line edit text to \fItext,\fR clears the selection and moves the cursor to the end of the line..PPIf necessary the text is truncated to maxLength()..PPSee also text()..PPExamples:.(lxform/xform.cpp.)l.SH "void QLineEdit::setValidator ( const QValidator * v ) \fC[virtual]\fR"Sets this line edit to accept input only as accepted by \fIv,\fR allowing arbitrary constraints on the text which the user can edit..PPIf \fIv\fR == 0, remove the current input validator. The default is no input validator (ie. any input is accepted up to maxLength())..PPSee also validator() and QValidator..SH "QSize QLineEdit::sizeHint () const \fC[virtual]\fR"Returns a recommended size for the widget..PPThe width returned is enough for a few characters, typically 15 to 20..PPReimplemented from QWidget..SH "QSizePolicy QLineEdit::sizePolicy () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QString QLineEdit::text () const"Returns the text in the line..PPSee also setText()..SH "void QLineEdit::textChanged ( const QString & ) \fC[signal]\fR"This signal is emitted every time the text changes. The argument is the new text..SH "bool QLineEdit::validateAndSet ( const QString & newText, int newPos, int newMarkAnchor, int newMarkDrag )"Validates and perhaps sets this line edit to contain \fInewText\fR with the cursor at position newPos, with marked text from \fInewMarkAnchor\fR to \fInewMarkDrag.\fR Returns TRUE if it changes the line edit and FALSE if it doesn't..PPLinebreaks in \fInewText\fR are converted to spaces, and it is truncated to maxLength() before testing its validity..PPRepaints and emits textChanged() if appropriate..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()..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 make our job much simpler. Thank you..PIn case of content or formattting problems with this manual page, pleasereport them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qlineedit.3qt) and the Qtversion (2.3.7).
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -