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

📄 qlineedit.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QLineEdit 3qt "9 December 2002" "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 NAMEQLineEdit \- One-line text editor.SH SYNOPSIS\fC#include <qlineedit.h>\fR.PPInherits QFrame..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQLineEdit\fR ( QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fBQLineEdit\fR ( const QString & contents, QWidget * parent, const char * name = 0 )".br.ti -1c.BI "\fB~QLineEdit\fR ()".br.ti -1c.BI "QString \fBtext\fR () const".br.ti -1c.BI "QString \fBdisplayText\fR () const".br.ti -1c.BI "int \fBmaxLength\fR () const".br.ti -1c.BI "bool \fBframe\fR () const".br.ti -1c.BI "enum \fBEchoMode\fR { Normal, NoEcho, Password }".br.ti -1c.BI "EchoMode \fBechoMode\fR () const".br.ti -1c.BI "bool \fBisReadOnly\fR () const".br.ti -1c.BI "const QValidator * \fBvalidator\fR () const".br.ti -1c.BI "virtual QSize \fBsizeHint\fR () const".br.ti -1c.BI "virtual QSize \fBminimumSizeHint\fR () const".br.ti -1c.BI "int \fBcursorPosition\fR () const".br.ti -1c.BI "bool \fBvalidateAndSet\fR ( const QString & newText, int newPos, int newMarkAnchor, int newMarkDrag )".br.ti -1c.BI "int \fBalignment\fR () const".br.ti -1c.BI "void cursorLeft ( bool mark, int steps = 1 )  \fI(obsolete)\fR".br.ti -1c.BI "void cursorRight ( bool mark, int steps = 1 )  \fI(obsolete)\fR".br.ti -1c.BI "void \fBcursorForward\fR ( bool mark, int steps = 1 )".br.ti -1c.BI "void \fBcursorBackward\fR ( bool mark, int steps = 1 )".br.ti -1c.BI "void \fBcursorWordForward\fR ( bool mark )".br.ti -1c.BI "void \fBcursorWordBackward\fR ( bool mark )".br.ti -1c.BI "void \fBbackspace\fR ()".br.ti -1c.BI "void \fBdel\fR ()".br.ti -1c.BI "void \fBhome\fR ( bool mark )".br.ti -1c.BI "void \fBend\fR ( bool mark )".br.ti -1c.BI "void \fBsetEdited\fR ( bool )".br.ti -1c.BI "bool \fBedited\fR () const".br.ti -1c.BI "bool \fBhasSelectedText\fR () const".br.ti -1c.BI "QString \fBselectedText\fR () const".br.ti -1c.BI "bool \fBgetSelection\fR ( int * start, int * end )".br.ti -1c.BI "bool \fBisUndoAvailable\fR () const".br.ti -1c.BI "bool \fBisRedoAvailable\fR () const".br.ti -1c.BI "bool hasMarkedText () const  \fI(obsolete)\fR".br.ti -1c.BI "QString markedText () const  \fI(obsolete)\fR".br.ti -1c.BI "bool \fBdragEnabled\fR () const".br.ti -1c.BI "int \fBcharacterAt\fR ( int xpos, QChar * chr ) const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetText\fR ( const QString & text )".br.ti -1c.BI "virtual void \fBselectAll\fR ()".br.ti -1c.BI "virtual void \fBdeselect\fR ()".br.ti -1c.BI "virtual void \fBclearValidator\fR ()".br.ti -1c.BI "virtual void \fBinsert\fR ( const QString & newText )".br.ti -1c.BI "virtual void \fBclear\fR ()".br.ti -1c.BI "virtual void \fBundo\fR ()".br.ti -1c.BI "virtual void \fBredo\fR ()".br.ti -1c.BI "virtual void \fBsetMaxLength\fR ( int )".br.ti -1c.BI "virtual void \fBsetFrame\fR ( bool )".br.ti -1c.BI "virtual void \fBsetEchoMode\fR ( EchoMode )".br.ti -1c.BI "virtual void \fBsetReadOnly\fR ( bool )".br.ti -1c.BI "virtual void \fBsetValidator\fR ( const QValidator * v )".br.ti -1c.BI "virtual void \fBsetSelection\fR ( int start, int length )".br.ti -1c.BI "virtual void \fBsetCursorPosition\fR ( int )".br.ti -1c.BI "virtual void \fBsetAlignment\fR ( int flag )".br.ti -1c.BI "virtual void \fBcut\fR ()".br.ti -1c.BI "virtual void \fBcopy\fR () const".br.ti -1c.BI "virtual void \fBpaste\fR ()".br.ti -1c.BI "virtual void \fBsetDragEnabled\fR ( bool b )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBtextChanged\fR ( const QString & )".br.ti -1c.BI "void \fBreturnPressed\fR ()".br.ti -1c.BI "void \fBlostFocus\fR ()".br.ti -1c.BI "void \fBselectionChanged\fR ()".br.in -1c.SS "Properties".in +1c.ti -1c.BI "Alignment \fBalignment\fR - the alignment of the line edit".br.ti -1c.BI "int \fBcursorPosition\fR - the current cursor position for this line edit".br.ti -1c.BI "QString \fBdisplayText\fR - the displayed text  \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBdragEnabled\fR - whether the lineedit starts a drag if the user presses and moves the mouse on some selected text".br.ti -1c.BI "EchoMode \fBechoMode\fR - the line edit's echo mode".br.ti -1c.BI "bool \fBedited\fR - whether the line edit has been edited".br.ti -1c.BI "bool \fBframe\fR - whether the line edit draws itself with a frame".br.ti -1c.BI "bool hasMarkedText - whether part of the text has been selected by the user (e.g. by clicking and " "dragging" ")  \fI(read " "only" ")\fR  \fI(obsolete)\fR".br.ti -1c.BI "bool \fBhasSelectedText\fR - whether there is any text selected  \fI(read " "only" ")\fR".br.ti -1c.BI "QString markedText - the text selected by the user (e.g. by clicking and " "dragging" "), or QString::null if no text is selected  \fI(read " "only" ")\fR  \fI(obsolete)\fR".br.ti -1c.BI "int \fBmaxLength\fR - the maximum permitted length of the text".br.ti -1c.BI "bool \fBreadOnly\fR - whether the line edit is read only".br.ti -1c.BI "bool \fBredoAvailable\fR - whether redo is available  \fI(read " "only" ")\fR".br.ti -1c.BI "QString \fBselectedText\fR - the selected text  \fI(read " "only" ")\fR".br.ti -1c.BI "QString \fBtext\fR - the line edit's text".br.ti -1c.BI "bool \fBundoAvailable\fR - whether undo is available  \fI(read " "only" ")\fR".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBkeyPressEvent\fR ( QKeyEvent * e )".br.ti -1c.BI "void repaintArea ( int from, int to )  \fI(obsolete)\fR".br.ti -1c.BI "virtual QPopupMenu * \fBcreatePopupMenu\fR ()".br.in -1c.SH DESCRIPTIONThe QLineEdit widget is a one-line text editor..PPA line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop..PPBy changing the echoMode() of a line edit, it can also be used as a "write-only" field, for inputs such as passwords..PPThe length of the field can be constrained to maxLength(), or the value can be arbitrarily constrained using a validator()..PPA related class is QTextEdit which allows multi-line, rich-text editing..PPYou can change the text with setText() or insert(). The text is retrieved with text(); the displayed text (which may be different, see EchoMode) is retrieved with displayText(). Text can be selected with setSelection() or selectAll(), and the selection can be cut(), copy()ied and paste()d. The text can be aligned with setAlignment()..PPWhen the text changes the textChanged() signal is emitted; when the Return or Enter key is pressed the returnPressed() signal is emitted. Note that if there is a validator set on the line edit, the returnPressed() signal will only be emitted if the validator returns Acceptable..PPBy default, QLineEdits have a frame as specified by the Windows and Motif style guides; you can turn it off by calling setFrame(FALSE)..PPThe default key bindings are described below. A right mouse button menu presents some of the editing commands to the user. <center>.nf.TSl - l. Keypress Action Left Arrow moves the cursor one character to the left. Right Arrow moves the cursor one character to the right. Backspace deletes the character to the left of the cursor. Ctrl+Backspace Delete the word to the left of the cursor Delete Delete the character to the right of the cursor Ctrl+Delete Delete the word to the right of the cursor Home moves the cursor to the beginning of the line. End moves the cursor to the end of the line. Delete deletes the character to the right of the cursor. Shift+Left Arrow moves and selects text one character to the left. Shift+Right Arrow moves and selects text one character to the right. Ctrl+A moves the cursor to the beginning of the line. Ctrl+B moves the cursor one character to the left. Ctrl+C copies the selected text to the clipboard. (Windows also supports Ctrl+Insert for this operation.) Ctrl+D deletes the character to the right of the cursor. Ctrl+E moves the cursor to the end of the line. Ctrl+F moves the cursor one character to the right. Ctrl+H deletes the character to the left of the cursor. Ctrl+K deletes to the end of the line. Ctrl+V pastes the clipboard text into line edit. (Windows also supports Shift+Insert for this operation.) Ctrl+X deletes the selected text and copies it to the clipboard. (Windows also supports Shift+Delete for this operation.) Ctrl+Z undoes the last operation. Ctrl+Y.TE.fi</center>.PPAny other key sequence, that represents a valid character, will cause the character to be inserted into the line..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QTextEdit, QLabel, QComboBox, GUI Design Handbook: Field, Entry, and Basic Widgets..SS "Member Type Documentation".SH "QLineEdit::EchoMode"This enum type describes how a line edit should display its contents..TP\fCQLineEdit::Normal\fR - display characters as they are entered. This is the default..TP\fCQLineEdit::NoEcho\fR - do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret..TP\fCQLineEdit::Password\fR - display asterisks instead of the characters actually entered..PPSee also echoMode and echoMode..SH MEMBER FUNCTION DOCUMENTATION.SH "QLineEdit::QLineEdit ( QWidget * parent, const char * name = 0 )"Constructs a line edit with no text..PPThe maximum text length is set to 32767 characters..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..PPSee also text and maxLength..SH "QLineEdit::QLineEdit ( const QString & contents, QWidget * parent, const char * name = 0 )"Constructs a line edit containing the text \fIcontents\fR..PPThe cursor position is set to the end of the line and the maximum text length to 32767 characters..PPThe \fIparent\fR and \fIname\fR arguments are sent to the QWidget constructor..PPSee also text and maxLength..SH "QLineEdit::~QLineEdit ()"Destroys the line edit..SH "int QLineEdit::alignment () const"Returns the alignment of the line edit. See the "alignment" property for details..SH "void QLineEdit::backspace ()"Deletes the character to the left of the text cursor and moves the cursor one position to the left. 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 del()..SH "int QLineEdit::characterAt ( int xpos, QChar * chr ) const"Returns the index position of the character which is at \fIxpos\fR (in logical coordinates from the left). If \fIchr\fR is not 0, \fI*chr\fR is populated with the character at this position.

⌨️ 快捷键说明

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