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

📄 qlineedit.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.SH "void QLineEdit::clearValidator () \fC[slot]\fR"This slot is equivalent to setValidator( 0 )..SH "void QLineEdit::copy () const"Copies the marked text to the clipboard, if there is any and echoMode() is Normal..PPSee also: cut() and paste()..SH "void QLineEdit::cursorLeft ( bool mark, int steps = 1 )"Moves the cursor leftwards one or more characters..PPSee also: cursorRight()..SH "int QLineEdit::cursorPosition () const"Returns the current cursor position for this line edit..PPSee also: setCursorPosition()..SH "void QLineEdit::cursorRight ( bool mark, int steps = 1 )"Moves the cursor rightwards one or more characters..PPSee also: cursorLeft()..SH "void QLineEdit::cursorWordBackward ( bool mark )"Moves the cursor one word to the left. If \fImark\fR is TRUE, the text is marked..PPSee also: cursorWordForward()..SH "void QLineEdit::cursorWordForward ( bool mark )"Moves the cursor one word to the right. If \fImark\fR is TRUE, the text is marked..PPSee also: cursorWordBackward()..SH "void QLineEdit::cut ()"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's currently 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() and text()..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 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 "void QLineEdit::focusInEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Handles the cursor blinking..PPReimplemented from QWidget..SH "void QLineEdit::focusOutEvent ( QFocusEvent * ) \fC[virtual protected]\fR"Handles the cursor blinking and selection copying..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)..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 currently selected text, inserts \fInewText,\fR validates the result and if it is valid, sets it as the new contents of the line edit..SH "void QLineEdit::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"The key press event handler converts a key press to some line editor action..PPIf return or enter is pressed and the current text is valid (or if the validator can make the text valid), the signal returnPressed is emitted..PPHere are the default key bindings:.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 Mark text one character leftwards.TP\fI Shift - Right Arrow \fR 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-V \fR Paste the clipboard text into line edit..TP\fI Control-X \fR Cut the marked text, copy to 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"Handles selection copying..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 current maximum 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 tends to be enough for one character..PPReimplemented from QWidget..SH "void QLineEdit::mouseDoubleClickEvent ( QMouseEvent * ) \fC[virtual protected]\fR"Handles mouse double click events for this widget..PPReimplemented from QWidget..SH "void QLineEdit::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse move events for the line editor, primarily for marking text..PPReimplemented from QWidget..SH "void QLineEdit::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse press events for this widget..PPReimplemented from QWidget..SH "void QLineEdit::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse release events for this widget..PPReimplemented from QWidget..SH "void QLineEdit::paintEvent ( QPaintEvent * e ) \fC[virtual protected]\fR"Handles paint events for the line editor..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"Handles resize events for this widget..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. Useful when a default value has been inserted. 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 editor. Possible Values are Qt::AlignLeft, Qt::AlignRight and Qt::AlignCenter..PPSee also: alignment()..SH "void QLineEdit::setCursorPosition ( int newPos ) \fC[virtual]\fR"Set the cursor position for this line edit to \fInewPos\fR and repaint accordingly..PPSee also: cursorPosition()..SH "void QLineEdit::setEchoMode ( EchoMode mode ) \fC[virtual]\fR"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. .TP\fCPassword\fR - display asterisks instead of the characters actually entered. .PPIt is always possible to cut and paste any marked text; only the widget's own display is affected..PPSee also: echoMode()..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 two-pixel 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() and QComboBox..SH "void QLineEdit::setMaxLength ( int m ) \fC[virtual]\fR"Set the maximum length of the text in the editor. If the text is currently 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::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 editor text to \fItext,\fR clears the selection and moves the cursor to the end of the line..PPIf necessary the text is truncated to fit 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.PPIf \fIv\fR == 0, remove the currently set 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 size which fits the contents of the line edit..PPThe width returned tends to be enough for about 15-20 characters..PPReimplemented from QWidget..SH "QSizePolicy QLineEdit::sizePolicy () const \fC[virtual]\fR"Specifies that this widget can use more, but is able to survive on less, horizontal space; and is fixed vertically..PPReimplemented from QWidget..SH "QString QLineEdit::text () const"Returns the text currently in the line..PPSee also: setText()..SH "void QLineEdit::textChanged ( const QString & ) \fC[signal]\fR"This signal is emitted every time the text has changed. 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() if necessary 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 novalidator has been set..SH "SEE ALSO".BR http://www.troll.no/qt/qlineedit.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

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