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

📄 qlineedit.3qt

📁 Trolltech公司发布的基于C++图形开发环境
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QLineEdit 3qt "24 January 2005" "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.br.PP\fC#include <qlineedit.h>\fR.PPInherits QWidget..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 &, 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 "virtual void \fBsetMaxLength\fR ( int ) ".br.ti -1c.BI "virtual void \fBsetFrame\fR ( bool ) ".br.ti -1c.BI "bool \fBframe\fR () const".br.ti -1c.BI "enum \fBEchoMode\fR { Normal, NoEcho, Password }".br.ti -1c.BI "virtual void \fBsetEchoMode\fR ( EchoMode ) ".br.ti -1c.BI "EchoMode \fBechoMode\fR () const".br.ti -1c.BI "void \fBsetReadOnly\fR ( bool ) ".br.ti -1c.BI "bool \fBisReadOnly\fR () const".br.ti -1c.BI "virtual void \fBsetValidator\fR ( const QValidator * ) ".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 "virtual void \fBsetSelection\fR ( int, int ) ".br.ti -1c.BI "virtual void \fBsetCursorPosition\fR ( int ) ".br.ti -1c.BI "int \fBcursorPosition\fR () const".br.ti -1c.BI "bool \fBvalidateAndSet\fR ( const QString &, int, int, int ) ".br.ti -1c.BI "void \fBcut\fR () ".br.ti -1c.BI "void \fBcopy\fR () const".br.ti -1c.BI "void \fBpaste\fR () ".br.ti -1c.BI "void \fBsetAlignment\fR ( int flag ) ".br.ti -1c.BI "int \fBalignment\fR () const".br.ti -1c.BI "void \fBcursorLeft\fR ( bool " "mark" ", int " "steps" " = 1 ) ".br.ti -1c.BI "void \fBcursorRight\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 \fBhasMarkedText\fR () const".br.ti -1c.BI "QString \fBmarkedText\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetText\fR ( const QString & ) ".br.ti -1c.BI "void \fBselectAll\fR () ".br.ti -1c.BI "void \fBdeselect\fR () ".br.ti -1c.BI "void \fBclearValidator\fR () ".br.ti -1c.BI "void \fBinsert\fR ( const QString & ) ".br.ti -1c.BI "void \fBclear\fR () ".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBtextChanged\fR ( const QString & ) ".br.ti -1c.BI "void \fBreturnPressed\fR () ".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBkeyPressEvent\fR ( QKeyEvent * ) ".br.ti -1c.BI "void \fBrepaintArea\fR ( int, int ) ".br.in -1c.SS "Properties".nf.TSl l l l l- - - - -l l l l l.Type	Name	READ	WRITE	OptionsQString	text	text	setTextint	maxLength	maxLength	setMaxLengthbool	frame	frame	setFrameEchoMode	echoMode	echoMode	setEchoModeQString	displayText	displayTextint	cursorPosition	cursorPosition	setCursorPositionAlignment	alignment	alignment	setAlignmentbool	edited	edited	setEditedbool	hasMarkedText	hasMarkedTextQString	markedText	markedText.TE.fi.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 & redo, cut & paste, and drag & 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 a maxLength(), or the value can be arbitrarily constrained by setting a validator()..PPA closely related class is QMultiLineEdit which allows multi-line editing..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 in keyPressEvent(). A right-mouse-button menu presents a number of the editing commands to the user..PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QMultiLineEdit, QLabel, QComboBox, GUI Design Handbook: Field, Entry, and GUI Design Handbook: Field, Required..PPExamples:.(llayout/layout.cpp xform/xform.cpp popup/popup.cpp.)l.SS "Member Type Documentation".SH "QLineEdit::EchoMode"This enum type describes how QLineEdit displays its contents. The defined values 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..PPSee also setEchoMode(), echoMode() and QMultiLineEdit::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 setText() and setMaxLength()..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 setMaxLength()..SH "QLineEdit::~QLineEdit ()"Destructs the line edit..SH "int QLineEdit::alignment () const"Returns the alignment of the line edit. Possible Values are Qt::AlignLeft, Qt::AlignRight and Qt::Align(H)Center..PPSee also setAlignment() and Qt::AlignmentFlags..SH "void QLineEdit::backspace ()"Deletes the character to the left of the text cursor and moves the cursor one position to the left. 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 del()..SH "void QLineEdit::clear () \fC[slot]\fR"Syntactic sugar for setText( "" ), provided to match no-argument signals..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 if 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 ()"

⌨️ 快捷键说明

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