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

📄 qlineedit.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QLineEdit 3qt "11 October 2001" "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.PP\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 & )".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 \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 text that is displayed  \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 echo mode of the line edit".br.ti -1c.BI "bool \fBedited\fR - the edited flag of the line edit".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 in the editor".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 - any text selected by the user or QString::null  \fI(read " "only" ")\fR".br.ti -1c.BI "QString \fBtext\fR - the text in the line".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 by setting a validator()..PPA closely 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..PPThe default QLineEdit object has its own frame as specified by the Windows/Motif style guides; you can turn off the frame 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..TP\fILeft\fR Arrow - moves the cursor one character to the left..TP\fIRight\fR Arrow - moves the cursor one character to the right..TP\fIBackspace\fR - deletes the character to the left of the cursor..TP\fIHome\fR - moves the cursor to the beginning of the line..TP\fIEnd\fR - moves the cursor to the end of the line..TP\fIDelete\fR - deletes the character to the right of the cursor..TP\fIShift+Left\fR Arrow - moves and selects text one character to the left..TP\fIShift+Right\fR Arrow - moves and selects text one character to the right..TP\fICtrl+A\fR - moves the cursor to the beginning of the line..TP\fICtrl+B\fR - moves the cursor one character to the left..TP\fICtrl+C\fR - copies the selected text to the clipboard. (Windows also supports Ctrl+Insert for this operation.).TP\fICtrl+D\fR - deletes the character to the right of the cursor..TP\fICtrl+E\fR - moves the cursor to the end of the line..TP\fICtrl+F\fR - moves the cursor one character to the right..TP\fICtrl+H\fR - deletes the character to the left of the cursor..TP\fICtrl+K\fR - deletes to the end of the line..TP\fICtrl+V\fR - pastes the clipboard text into line edit. (Windows also supports Shift+Insert for this operation.).TP\fICtrl+X\fR - deletes the selected text and copies it to the clipboard. (Windows also supports Shift+Delete for this operation.).TP\fICtrl+Z\fR - undoes the last operation..TP\fICtrl+Y\fR - redoes the last undone operation..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, GUI Design Handbook: Field, Required and Basic Widgets..SS "Member Type Documentation".SH "QLineEdit::EchoMode"This enum type describes how a line edit should display its contents. The defined values are:.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..PP

⌨️ 快捷键说明

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