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

📄 qlineedit.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.SH "void QLineEdit::clear ()\fC [virtual slot]\fR"Clears the contents of the editor. The edited property is set to FALSE. Undo/redo history is updated..SH "void QLineEdit::clearValidator ()\fC [virtual slot]\fR"This slot is equivalent to setValidator( 0 )..SH "void QLineEdit::copy () const\fC [virtual slot]\fR"Copies the selected text to the clipboard, if there is any, and if echoMode() is Normal..PPSee also cut() and paste()..SH "QPopupMenu * QLineEdit::createPopupMenu ()\fC [virtual protected]\fR"This function is called to create the popup menu which is shown when the user clicks on the line edit with the right mouse button. If you want to create a custom popup menu, reimplement this function and return the popup menu you create. The popup menu's ownership is transferred to the caller..SH "void QLineEdit::cursorBackward ( bool mark, int steps = 1 )"Moves the cursor back \fIsteps\fR characters. If \fImark\fR is TRUE each character moved over is added to the selection; if \fImark\fR is FALSE the selection is cleared..PPSee also cursorForward()..SH "void QLineEdit::cursorForward ( bool mark, int steps = 1 )"Moves the cursor forward \fIsteps\fR characters. If \fImark\fR is TRUE each character moved over is added to the selection; if \fImark\fR is FALSE the selection is cleared..PPSee also cursorBackward()..SH "void QLineEdit::cursorLeft ( bool mark, int steps = 1 )"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPFor compatibilty with older applications only. Use cursorBackward() instead..PPSee also cursorBackward()..SH "int QLineEdit::cursorPosition () const"Returns the current cursor position for this line edit. See the "cursorPosition" property for details..SH "void QLineEdit::cursorRight ( bool mark, int steps = 1 )"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPUse cursorForward() instead..PPSee also cursorForward()..SH "void QLineEdit::cursorWordBackward ( bool mark )"Moves the cursor one word backward. If \fImark\fR is TRUE, the word is also selected..PPSee also cursorWordForward()..SH "void QLineEdit::cursorWordForward ( bool mark )"Moves the cursor one word forward. If \fImark\fR is TRUE, the word is also selected..PPSee also cursorWordBackward()..SH "void QLineEdit::cut ()\fC [virtual slot]\fR"Copies the selected text to the clipboard and deletes it, if there is any, and if echoMode() is Normal..PPIf the current validator disallows deleting the selected text, cut() will copy it but not delete it..PPSee also copy() and paste()..SH "void QLineEdit::del ()"Deletes the character to the right of the text cursor. If any text has been selected by the user (e.g. by clicking and dragging), the cursor will be put at the beginning of the selected text and the selected text will be removed..PPSee also backspace()..SH "void QLineEdit::deselect ()\fC [virtual slot]\fR"De-selects all text (i.e. removes highlighting) and leaves the cursor at the current position..PPSee also setSelection() and selectAll()..SH "QString QLineEdit::displayText () const"Returns the displayed text. See the "displayText" property for details..SH "bool QLineEdit::dragEnabled () const"Returns TRUE if the lineedit starts a drag if the user presses and moves the mouse on some selected text; otherwise returns FALSE. See the "dragEnabled" property for details..SH "EchoMode QLineEdit::echoMode () const"Returns the line edit's echo mode. See the "echoMode" property for details..SH "bool QLineEdit::edited () const"Returns TRUE if the line edit has been edited; otherwise returns FALSE. See the "edited" property for details..SH "void QLineEdit::end ( bool mark )"Moves the text cursor to the end of the line. If \fImark\fR is TRUE, text is selected towards the last position; otherwise, any selected text is unselected if the cursor is moved..PPSee also home()..SH "bool QLineEdit::frame () const"Returns TRUE if the line edit draws itself with a frame; otherwise returns FALSE. See the "frame" property for details..SH "bool QLineEdit::getSelection ( int * start, int * end )"This function sets \fI*start\fR to the position in the text where the selection starts and \fI*end\fR to the position where the selection ends. Returns TRUE if both \fIstart\fR and \fIend\fR are not 0 and if there is some selected text; otherwise returns FALSE..PPSee also setSelection()..SH "bool QLineEdit::hasMarkedText () const"Returns TRUE if part of the text has been selected by the user (e.g. by clicking and dragging); otherwise returns FALSE. See the "hasMarkedText" property for details..SH "bool QLineEdit::hasSelectedText () const"Returns TRUE if there is any text selected; otherwise returns FALSE. See the "hasSelectedText" property for details..SH "void QLineEdit::home ( bool mark )"Moves the text cursor to the beginning of the line. If \fImark\fR is TRUE, text is selected towards the first position; otherwise, any selected text is unselected if the cursor is moved..PPSee also end()..SH "void QLineEdit::insert ( const QString & newText )\fC [virtual slot]\fR"Removes any selected text, inserts \fInewText\fR, and validates the result. If it is valid, it sets it as the new contents of the line edit..SH "bool QLineEdit::isReadOnly () const"Returns TRUE if the line edit is read only; otherwise returns FALSE. See the "readOnly" property for details..SH "bool QLineEdit::isRedoAvailable () const"Returns TRUE if redo is available; otherwise returns FALSE. See the "redoAvailable" property for details..SH "bool QLineEdit::isUndoAvailable () const"Returns TRUE if undo is available; otherwise returns FALSE. See the "undoAvailable" property for details..SH "void QLineEdit::keyPressEvent ( QKeyEvent * e )\fC [virtual protected]\fR"Converts key press event \fIe\fR 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 listed in the detailed description..PPReimplemented from QWidget..SH "void QLineEdit::lostFocus ()\fC [signal]\fR"This signal is emitted when the line edit has lost focus..PPSee also focus, QWidget::focusInEvent(), and QWidget::focusOutEvent()..SH "QString QLineEdit::markedText () const"Returns the text selected by the user (e.g. by clicking and dragging), or QString::null if no text is selected. See the "markedText" property for details..SH "int QLineEdit::maxLength () const"Returns the maximum permitted length of the text. See the "maxLength" property for details..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::paste ()\fC [virtual slot]\fR"Inserts the clipboard's text at the cursor position, deleting any selected text..PPIf the end result is not acceptable for the current validator, nothing happens..PPSee also copy() and cut()..SH "void QLineEdit::redo ()\fC [virtual slot]\fR"Redoes the last operation..SH "void QLineEdit::repaintArea ( int from, int to )\fC [protected]\fR"\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code..PPRepaints all characters from \fIfrom\fR to \fIto\fR. If cursorPos is between from and to, ensures that cursorPos is visible..SH "void QLineEdit::returnPressed ()\fC [signal]\fR"This signal is emitted when the Return or Enter key is pressed. Note that if there is a validator set on the line edit, the returnPressed() signal will only be emitted if the validator returns Acceptable..PPExample: popup/popup.cpp..SH "void QLineEdit::selectAll ()\fC [virtual slot]\fR"Selects all the text (i.e. highlights it) and moves the cursor to the end. This is useful when a default value has been inserted because if the user types before clicking on the widget, the selected text will be erased..PPSee also setSelection() and deselect()..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 "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. 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::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"Sets the selected area of this line edit to start at position \fIstart\fR and be \fIlength\fR characters long..PPSee also deselect(), selectAll(), and getSelection()..SH "void QLineEdit::setText ( const QString & text )\fC [virtual slot]\fR"Sets the line edit's text to \fItext\fR. 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() and QValidator..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 wizard/wizard.cpp and xform/xform.cpp..SH "void QLineEdit::undo ()\fC [virtual slot]\fR"Undoes the last operation..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 \fInewPos\fR, with selected text from \fInewMarkAnchor\fR to \fInewMarkDrag\fR. Returns TRUE if it changes the line edit; otherwise returns FALSE..PPLinebreaks in \fInewText\fR are converted to spaces, and the text is truncated to maxLength() before its validity is tested..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()..PPExample: wizard/wizard.cpp..SS "Property Documentation".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 the 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"This property holds whether the line edit has been edited..PPThe edited 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 cannot find the default at once. Just start the line edit without the best default; 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..PPCalling setText() resets the edited flag to FALSE..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 (e.g. by clicking and dragging)..PPGet this property's value with hasMarkedText()..PPSee also selectedText..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 (e.g. by clicking and dragging); otherwise returns FALSE..PPSee also selectedText..PPGet this property's value with hasSelectedText()..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 (e.g. by clicking and dragging), or QString::null if no text is selected..PPGet this property's value with markedText()..PPSee also hasSelectedText..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..PPSet this property's value with setMaxLength() and get this property's value with maxLength()..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, 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, moves the cursor to the end of the line and resets the edited property to FALSE..PPThe text is truncated to maxLength() length..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.1.1).

⌨️ 快捷键说明

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