You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/html/ntqlineedit.html

729 lines
48 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qlineedit.cpp:268 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQLineEdit Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQLineEdit Class Reference</h1>
<p>The TQLineEdit widget is a one-line text editor.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qlineedit-h.html">ntqlineedit.h</a>&gt;</tt>
<p>Inherits <a href="ntqframe.html">TQFrame</a>.
<p><a href="qlineedit-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQLineEdit"><b>TQLineEdit</b></a> ( TQWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQLineEdit-2"><b>TQLineEdit</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;contents, TQWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#TQLineEdit-3"><b>TQLineEdit</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;contents, const&nbsp;TQString&nbsp;&amp;&nbsp;inputMask, TQWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
<li class=fn><a href="#~TQLineEdit"><b>~TQLineEdit</b></a> ()</li>
<li class=fn>TQString <a href="#text"><b>text</b></a> () const</li>
<li class=fn>TQString <a href="#displayText"><b>displayText</b></a> () const</li>
<li class=fn>int <a href="#maxLength"><b>maxLength</b></a> () const</li>
<li class=fn>bool <a href="#frame"><b>frame</b></a> () const</li>
<li class=fn>enum <a href="#EchoMode-enum"><b>EchoMode</b></a> { Normal, NoEcho, Password }</li>
<li class=fn>EchoMode <a href="#echoMode"><b>echoMode</b></a> () const</li>
<li class=fn>bool <a href="#isReadOnly"><b>isReadOnly</b></a> () const</li>
<li class=fn>const TQValidator * <a href="#validator"><b>validator</b></a> () const</li>
<li class=fn>virtual TQSize <a href="#sizeHint"><b>sizeHint</b></a> () const</li>
<li class=fn>virtual TQSize <a href="#minimumSizeHint"><b>minimumSizeHint</b></a> () const</li>
<li class=fn>int <a href="#cursorPosition"><b>cursorPosition</b></a> () const</li>
<li class=fn>bool validateAndSet ( const&nbsp;TQString&nbsp;&amp;&nbsp;newText, int&nbsp;newPos, int&nbsp;newMarkAnchor, int&nbsp;newMarkDrag ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>int <a href="#alignment"><b>alignment</b></a> () const</li>
<li class=fn>void <a href="#cursorForward"><b>cursorForward</b></a> ( bool&nbsp;mark, int&nbsp;steps = 1 )</li>
<li class=fn>void <a href="#cursorBackward"><b>cursorBackward</b></a> ( bool&nbsp;mark, int&nbsp;steps = 1 )</li>
<li class=fn>void <a href="#cursorWordForward"><b>cursorWordForward</b></a> ( bool&nbsp;mark )</li>
<li class=fn>void <a href="#cursorWordBackward"><b>cursorWordBackward</b></a> ( bool&nbsp;mark )</li>
<li class=fn>void <a href="#backspace"><b>backspace</b></a> ()</li>
<li class=fn>void <a href="#del"><b>del</b></a> ()</li>
<li class=fn>void <a href="#home"><b>home</b></a> ( bool&nbsp;mark )</li>
<li class=fn>void <a href="#end"><b>end</b></a> ( bool&nbsp;mark )</li>
<li class=fn>bool <a href="#isModified"><b>isModified</b></a> () const</li>
<li class=fn>void <a href="#clearModified"><b>clearModified</b></a> ()</li>
<li class=fn>bool edited () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>void setEdited ( bool ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool <a href="#hasSelectedText"><b>hasSelectedText</b></a> () const</li>
<li class=fn>TQString <a href="#selectedText"><b>selectedText</b></a> () const</li>
<li class=fn>int <a href="#selectionStart"><b>selectionStart</b></a> () const</li>
<li class=fn>bool <a href="#isUndoAvailable"><b>isUndoAvailable</b></a> () const</li>
<li class=fn>bool <a href="#isRedoAvailable"><b>isRedoAvailable</b></a> () const</li>
<li class=fn>bool <a href="#dragEnabled"><b>dragEnabled</b></a> () const</li>
<li class=fn>TQString <a href="#inputMask"><b>inputMask</b></a> () const</li>
<li class=fn>void <a href="#setInputMask"><b>setInputMask</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;inputMask )</li>
<li class=fn>bool <a href="#hasAcceptableInput"><b>hasAcceptableInput</b></a> () const</li>
<li class=fn>int characterAt ( int&nbsp;xpos, TQChar&nbsp;*&nbsp;chr ) const &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool getSelection ( int&nbsp;*&nbsp;start, int&nbsp;*&nbsp;end ) &nbsp;<em>(obsolete)</em></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const TQString &amp; )</li>
<li class=fn>virtual void <a href="#selectAll"><b>selectAll</b></a> ()</li>
<li class=fn>virtual void <a href="#deselect"><b>deselect</b></a> ()</li>
<li class=fn>virtual void <a href="#clearValidator"><b>clearValidator</b></a> ()</li>
<li class=fn>virtual void <a href="#insert"><b>insert</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;newText )</li>
<li class=fn>virtual void <a href="#clear"><b>clear</b></a> ()</li>
<li class=fn>virtual void <a href="#undo"><b>undo</b></a> ()</li>
<li class=fn>virtual void <a href="#redo"><b>redo</b></a> ()</li>
<li class=fn>virtual void <a href="#setMaxLength"><b>setMaxLength</b></a> ( int )</li>
<li class=fn>virtual void <a href="#setFrame"><b>setFrame</b></a> ( bool )</li>
<li class=fn>virtual void <a href="#setEchoMode"><b>setEchoMode</b></a> ( EchoMode )</li>
<li class=fn>virtual void <a href="#setReadOnly"><b>setReadOnly</b></a> ( bool )</li>
<li class=fn>virtual void <a href="#setValidator"><b>setValidator</b></a> ( const&nbsp;TQValidator&nbsp;*&nbsp;v )</li>
<li class=fn>virtual void <a href="#setSelection"><b>setSelection</b></a> ( int&nbsp;start, int&nbsp;length )</li>
<li class=fn>virtual void <a href="#setCursorPosition"><b>setCursorPosition</b></a> ( int )</li>
<li class=fn>virtual void <a href="#setAlignment"><b>setAlignment</b></a> ( int&nbsp;flag )</li>
<li class=fn>virtual void <a href="#cut"><b>cut</b></a> ()</li>
<li class=fn>virtual void <a href="#copy"><b>copy</b></a> () const</li>
<li class=fn>virtual void <a href="#paste"><b>paste</b></a> ()</li>
<li class=fn>virtual void <a href="#setDragEnabled"><b>setDragEnabled</b></a> ( bool&nbsp;b )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#textChanged"><b>textChanged</b></a> ( const TQString &amp; )</li>
<li class=fn>void <a href="#returnPressed"><b>returnPressed</b></a> ()</li>
<li class=fn>void <a href="#lostFocus"><b>lostFocus</b></a> ()</li>
<li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li>
</ul>
<h2>Properties</h2>
<ul>
<li class=fn>bool <a href="#acceptableInput-prop"><b>acceptableInput</b></a>&nbsp;- whether the input satisfies the inputMask and the validator &nbsp;<em>(read only)</em></li>
<li class=fn>Alignment <a href="#alignment-prop"><b>alignment</b></a>&nbsp;- the alignment of the line edit</li>
<li class=fn>int <a href="#cursorPosition-prop"><b>cursorPosition</b></a>&nbsp;- the current cursor position for this line edit</li>
<li class=fn>TQString <a href="#displayText-prop"><b>displayText</b></a>&nbsp;- the displayed text &nbsp;<em>(read only)</em></li>
<li class=fn>bool <a href="#dragEnabled-prop"><b>dragEnabled</b></a>&nbsp;- whether the lineedit starts a drag if the user presses and moves the mouse on some selected text</li>
<li class=fn>EchoMode <a href="#echoMode-prop"><b>echoMode</b></a>&nbsp;- the line edit's echo mode</li>
<li class=fn>bool edited&nbsp;- whether the line edit has been edited. Use modified instead &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool <a href="#frame-prop"><b>frame</b></a>&nbsp;- whether the line edit draws itself with a frame</li>
<li class=fn>bool <a href="#hasSelectedText-prop"><b>hasSelectedText</b></a>&nbsp;- whether there is any text selected &nbsp;<em>(read only)</em></li>
<li class=fn>TQString <a href="#inputMask-prop"><b>inputMask</b></a>&nbsp;- the validation input mask</li>
<li class=fn>int <a href="#maxLength-prop"><b>maxLength</b></a>&nbsp;- the maximum permitted length of the text</li>
<li class=fn>bool <a href="#modified-prop"><b>modified</b></a>&nbsp;- whether the line edit's contents has been modified by the user &nbsp;<em>(read only)</em></li>
<li class=fn>bool <a href="#readOnly-prop"><b>readOnly</b></a>&nbsp;- whether the line edit is read only</li>
<li class=fn>bool <a href="#redoAvailable-prop"><b>redoAvailable</b></a>&nbsp;- whether redo is available &nbsp;<em>(read only)</em></li>
<li class=fn>TQString <a href="#selectedText-prop"><b>selectedText</b></a>&nbsp;- the selected text &nbsp;<em>(read only)</em></li>
<li class=fn>TQString <a href="#text-prop"><b>text</b></a>&nbsp;- the line edit's text</li>
<li class=fn>bool <a href="#undoAvailable-prop"><b>undoAvailable</b></a>&nbsp;- whether undo is available &nbsp;<em>(read only)</em></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#keyPressEvent"><b>keyPressEvent</b></a> ( TQKeyEvent&nbsp;*&nbsp;e )</li>
<li class=fn>virtual TQPopupMenu * <a href="#createPopupMenu"><b>createPopupMenu</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The TQLineEdit widget is a one-line text editor.
<p>
<p> A 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.
<p> By changing the <a href="#echoMode">echoMode</a>() of a line edit, it can also be used as
a "write-only" field, for inputs such as passwords.
<p> The length of the text can be constrained to <a href="#maxLength">maxLength</a>(). The text
can be arbitrarily constrained using a <a href="#validator">validator</a>() or an
<a href="#inputMask">inputMask</a>(), or both.
<p> A related class is <a href="ntqtextedit.html">TQTextEdit</a> which allows multi-line, rich-text
editing.
<p> You can change the text with <a href="#setText">setText</a>() or <a href="#insert">insert</a>(). The text is
retrieved with <a href="#text">text</a>(); the displayed text (which may be different,
see <a href="#EchoMode-enum">EchoMode</a>) is retrieved with <a href="#displayText">displayText</a>(). Text can be
selected with <a href="#setSelection">setSelection</a>() or <a href="#selectAll">selectAll</a>(), and the selection can
be <a href="#cut">cut</a>(), <a href="#copy">copy</a>()ied and <a href="#paste">paste</a>()d. The text can be aligned with
<a href="#setAlignment">setAlignment</a>().
<p> When the text changes the <a href="#textChanged">textChanged</a>() signal is emitted; when
the Return or Enter key is pressed the <a href="#returnPressed">returnPressed</a>() 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 <tt>Acceptable</tt>.
<p> By default, TQLineEdits have a frame as specified by the Windows
and <a href="motif-extension.html#Motif">Motif</a> style guides; you can turn it off by calling
<a href="#setFrame">setFrame</a>(FALSE).
<p> The default key bindings are described below. The line edit also
provides a context menu (usually invoked by a right mouse click)
that presents some of these editing options.
<a name="desc"></a>
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Keypress <th valign="top">Action
<tr bgcolor="#f0f0f0"> <td valign="top">Left Arrow <td valign="top">Moves the cursor one character to the left.
<tr bgcolor="#d0d0d0"> <td valign="top">Shift+Left Arrow <td valign="top">Moves and selects text one character to the left.
<tr bgcolor="#f0f0f0"> <td valign="top">Right Arrow <td valign="top">Moves the cursor one character to the right.
<tr bgcolor="#d0d0d0"> <td valign="top">Shift+Right Arrow <td valign="top">Moves and selects text one character to the right.
<tr bgcolor="#f0f0f0"> <td valign="top">Home <td valign="top">Moves the cursor to the beginning of the line.
<tr bgcolor="#d0d0d0"> <td valign="top">End <td valign="top">Moves the cursor to the end of the line.
<tr bgcolor="#f0f0f0"> <td valign="top">Backspace <td valign="top">Deletes the character to the left of the cursor.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Backspace <td valign="top">Deletes the word to the left of the cursor.
<tr bgcolor="#f0f0f0"> <td valign="top">Delete <td valign="top">Deletes the character to the right of the cursor.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Delete <td valign="top">Deletes the word to the right of the cursor.
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+A <td valign="top">Moves the cursor to the beginning of the line.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+B <td valign="top">Moves the cursor one character to the left.
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+C <td valign="top">Copies the selected text to the clipboard.
(Windows also supports Ctrl+Insert for this operation.)
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+D <td valign="top">Deletes the character to the right of the cursor.
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+E <td valign="top">Moves the cursor to the end of the line.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+F <td valign="top">Moves the cursor one character to the right.
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+H <td valign="top">Deletes the character to the left of the cursor.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+K <td valign="top">Deletes to the end of the line.
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+V <td valign="top">Pastes the clipboard text into line edit.
(Windows also supports Shift+Insert for this operation.)
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+X <td valign="top">Deletes the selected text and copies it to the clipboard.
(Windows also supports Shift+Delete for this operation.)
<tr bgcolor="#f0f0f0"> <td valign="top">Ctrl+Z <td valign="top">Undoes the last operation.
<tr bgcolor="#d0d0d0"> <td valign="top">Ctrl+Y <td valign="top">Redoes the last undone operation.
</table></center>
<p> Any other key sequence that represents a valid character, will
cause the character to be inserted into the line edit.
<p> <img src=qlined-m.png> <img src=qlined-w.png>
<p> <p>See also <a href="ntqtextedit.html">TQTextEdit</a>, <a href="ntqlabel.html">TQLabel</a>, <a href="ntqcombobox.html">TQComboBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Field, Entry</a>, and <a href="basic.html">Basic Widgets</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="EchoMode-enum"></a>TQLineEdit::EchoMode</h3>
<p> This enum type describes how a line edit should display its
contents.
<ul>
<li><tt>TQLineEdit::Normal</tt> - Display characters as they are entered. This is the
default.
<li><tt>TQLineEdit::NoEcho</tt> - Do not display anything. This may be appropriate
for passwords where even the length of the
password should be kept secret.
<li><tt>TQLineEdit::Password</tt> - Display asterisks instead of the characters
actually entered.
</ul><p> <p>See also <a href="#echoMode-prop">echoMode</a> and <a href="#echoMode-prop">echoMode</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="TQLineEdit"></a>TQLineEdit::TQLineEdit ( <a href="ntqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a line edit with no text.
<p> The maximum text length is set to 32767 characters.
<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="ntqwidget.html">TQWidget</a> constructor.
<p> <p>See also <a href="#text-prop">text</a> and <a href="#maxLength-prop">maxLength</a>.
<h3 class=fn><a name="TQLineEdit-2"></a>TQLineEdit::TQLineEdit ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;contents, <a href="ntqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a line edit containing the text <em>contents</em>.
<p> The cursor position is set to the end of the line and the maximum
text length to 32767 characters.
<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="ntqwidget.html">TQWidget</a>
constructor.
<p> <p>See also <a href="#text-prop">text</a> and <a href="#maxLength-prop">maxLength</a>.
<h3 class=fn><a name="TQLineEdit-3"></a>TQLineEdit::TQLineEdit ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;contents, const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;inputMask, <a href="ntqwidget.html">TQWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0 )
</h3>
Constructs a line edit with an input <em>inputMask</em> and the text <em>contents</em>.
<p> The cursor position is set to the end of the line and the maximum
text length is set to the length of the mask (the number of mask
characters and separators).
<p> The <em>parent</em> and <em>name</em> arguments are sent to the <a href="ntqwidget.html">TQWidget</a>
constructor.
<p> <p>See also <a href="ntqwidget.html#setMask">setMask</a>() and <a href="#text-prop">text</a>.
<h3 class=fn><a name="~TQLineEdit"></a>TQLineEdit::~TQLineEdit ()
</h3>
Destroys the line edit.
<h3 class=fn>int <a name="alignment"></a>TQLineEdit::alignment () const
</h3><p>Returns the alignment of the line edit.
See the <a href="ntqlineedit.html#alignment-prop">"alignment"</a> property for details.
<h3 class=fn>void <a name="backspace"></a>TQLineEdit::backspace ()
</h3>
If no text is selected, deletes the character to the left of the
text cursor and moves the cursor one position to the left. If any
text is selected, the cursor is moved to the beginning of the
selected text and the selected text is deleted.
<p> <p>See also <a href="#del">del</a>().
<h3 class=fn>int <a name="characterAt"></a>TQLineEdit::characterAt ( int&nbsp;xpos, <a href="qchar.html">TQChar</a>&nbsp;*&nbsp;chr ) const
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p>
<h3 class=fn>void <a name="clear"></a>TQLineEdit::clear ()<tt> [virtual slot]</tt>
</h3>
Clears the contents of the line edit.
<h3 class=fn>void <a name="clearModified"></a>TQLineEdit::clearModified ()
</h3>
Resets the modified flag to FALSE.
<p> <p>See also <a href="#modified-prop">modified</a>.
<h3 class=fn>void <a name="clearValidator"></a>TQLineEdit::clearValidator ()<tt> [virtual slot]</tt>
</h3>
This slot is equivalent to <a href="#setValidator">setValidator</a>(0).
<h3 class=fn>void <a name="copy"></a>TQLineEdit::copy () const<tt> [virtual slot]</tt>
</h3>
Copies the selected text to the clipboard, if there is any, and if
<a href="#echoMode">echoMode</a>() is <a href="#EchoMode-enum">Normal</a>.
<p> <p>See also <a href="#cut">cut</a>() and <a href="#paste">paste</a>().
<h3 class=fn><a href="ntqpopupmenu.html">TQPopupMenu</a>&nbsp;* <a name="createPopupMenu"></a>TQLineEdit::createPopupMenu ()<tt> [virtual protected]</tt>
</h3>
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.
<h3 class=fn>void <a name="cursorBackward"></a>TQLineEdit::cursorBackward ( bool&nbsp;mark, int&nbsp;steps = 1 )
</h3>
Moves the cursor back <em>steps</em> characters. If <em>mark</em> is TRUE each
character moved over is added to the selection; if <em>mark</em> is
FALSE the selection is cleared.
<p> <p>See also <a href="#cursorForward">cursorForward</a>().
<h3 class=fn>void <a name="cursorForward"></a>TQLineEdit::cursorForward ( bool&nbsp;mark, int&nbsp;steps = 1 )
</h3>
Moves the cursor forward <em>steps</em> characters. If <em>mark</em> is TRUE
each character moved over is added to the selection; if <em>mark</em> is
FALSE the selection is cleared.
<p> <p>See also <a href="#cursorBackward">cursorBackward</a>().
<h3 class=fn>int <a name="cursorPosition"></a>TQLineEdit::cursorPosition () const
</h3><p>Returns the current cursor position for this line edit.
See the <a href="ntqlineedit.html#cursorPosition-prop">"cursorPosition"</a> property for details.
<h3 class=fn>void <a name="cursorWordBackward"></a>TQLineEdit::cursorWordBackward ( bool&nbsp;mark )
</h3>
Moves the cursor one word backward. If <em>mark</em> is TRUE, the word
is also selected.
<p> <p>See also <a href="#cursorWordForward">cursorWordForward</a>().
<h3 class=fn>void <a name="cursorWordForward"></a>TQLineEdit::cursorWordForward ( bool&nbsp;mark )
</h3>
Moves the cursor one word forward. If <em>mark</em> is TRUE, the word is
also selected.
<p> <p>See also <a href="#cursorWordBackward">cursorWordBackward</a>().
<h3 class=fn>void <a name="cut"></a>TQLineEdit::cut ()<tt> [virtual slot]</tt>
</h3>
Copies the selected text to the clipboard and deletes it, if there
is any, and if <a href="#echoMode">echoMode</a>() is <a href="#EchoMode-enum">Normal</a>.
<p> If the current validator disallows deleting the selected text,
<a href="#cut">cut</a>() will copy without deleting.
<p> <p>See also <a href="#copy">copy</a>(), <a href="#paste">paste</a>(), and <a href="#setValidator">setValidator</a>().
<h3 class=fn>void <a name="del"></a>TQLineEdit::del ()
</h3>
If no text is selected, deletes the character to the right of the
text cursor. If any text is selected, the cursor is moved to the
beginning of the selected text and the selected text is deleted.
<p> <p>See also <a href="#backspace">backspace</a>().
<h3 class=fn>void <a name="deselect"></a>TQLineEdit::deselect ()<tt> [virtual slot]</tt>
</h3>
Deselects any selected text.
<p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#selectAll">selectAll</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="displayText"></a>TQLineEdit::displayText () const
</h3><p>Returns the displayed text.
See the <a href="ntqlineedit.html#displayText-prop">"displayText"</a> property for details.
<h3 class=fn>bool <a name="dragEnabled"></a>TQLineEdit::dragEnabled () const
</h3><p>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 <a href="ntqlineedit.html#dragEnabled-prop">"dragEnabled"</a> property for details.
<h3 class=fn><a href="ntqlineedit.html#EchoMode-enum">EchoMode</a> <a name="echoMode"></a>TQLineEdit::echoMode () const
</h3><p>Returns the line edit's echo mode.
See the <a href="ntqlineedit.html#echoMode-prop">"echoMode"</a> property for details.
<h3 class=fn>bool <a name="edited"></a>TQLineEdit::edited () const
</h3><p>Returns TRUE if the line edit has been edited. Use modified instead; otherwise returns FALSE.
See the <a href="ntqlineedit.html#edited-prop">"edited"</a> property for details.
<h3 class=fn>void <a name="end"></a>TQLineEdit::end ( bool&nbsp;mark )
</h3>
Moves the text cursor to the end of the line unless it is already
there. If <em>mark</em> is TRUE, text is selected towards the last
position; otherwise, any selected text is unselected if the cursor
is moved.
<p> <p>See also <a href="#home">home</a>().
<h3 class=fn>bool <a name="frame"></a>TQLineEdit::frame () const
</h3><p>Returns TRUE if the line edit draws itself with a frame; otherwise returns FALSE.
See the <a href="ntqlineedit.html#frame-prop">"frame"</a> property for details.
<h3 class=fn>bool <a name="getSelection"></a>TQLineEdit::getSelection ( int&nbsp;*&nbsp;start, int&nbsp;*&nbsp;end )
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
use <a href="#selectedText">selectedText</a>(), <a href="#selectionStart">selectionStart</a>()
<h3 class=fn>bool <a name="hasAcceptableInput"></a>TQLineEdit::hasAcceptableInput () const
</h3><p>Returns TRUE if the input satisfies the inputMask and the validator; otherwise returns FALSE.
See the <a href="ntqlineedit.html#acceptableInput-prop">"acceptableInput"</a> property for details.
<h3 class=fn>bool <a name="hasSelectedText"></a>TQLineEdit::hasSelectedText () const
</h3><p>Returns TRUE if there is any text selected; otherwise returns FALSE.
See the <a href="ntqlineedit.html#hasSelectedText-prop">"hasSelectedText"</a> property for details.
<h3 class=fn>void <a name="home"></a>TQLineEdit::home ( bool&nbsp;mark )
</h3>
Moves the text cursor to the beginning of the line unless it is
already there. If <em>mark</em> is TRUE, text is selected towards the
first position; otherwise, any selected text is unselected if the
cursor is moved.
<p> <p>See also <a href="#end">end</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="inputMask"></a>TQLineEdit::inputMask () const
</h3><p>Returns the validation input mask.
See the <a href="ntqlineedit.html#inputMask-prop">"inputMask"</a> property for details.
<h3 class=fn>void <a name="insert"></a>TQLineEdit::insert ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;newText )<tt> [virtual slot]</tt>
</h3>
Deletes any selected text, inserts <em>newText</em>, and validates the
result. If it is valid, it sets it as the new contents of the line
edit.
<h3 class=fn>bool <a name="isModified"></a>TQLineEdit::isModified () const
</h3><p>Returns TRUE if the line edit's contents has been modified by the user; otherwise returns FALSE.
See the <a href="ntqlineedit.html#modified-prop">"modified"</a> property for details.
<h3 class=fn>bool <a name="isReadOnly"></a>TQLineEdit::isReadOnly () const
</h3><p>Returns TRUE if the line edit is read only; otherwise returns FALSE.
See the <a href="ntqlineedit.html#readOnly-prop">"readOnly"</a> property for details.
<h3 class=fn>bool <a name="isRedoAvailable"></a>TQLineEdit::isRedoAvailable () const
</h3><p>Returns TRUE if redo is available; otherwise returns FALSE.
See the <a href="ntqlineedit.html#redoAvailable-prop">"redoAvailable"</a> property for details.
<h3 class=fn>bool <a name="isUndoAvailable"></a>TQLineEdit::isUndoAvailable () const
</h3><p>Returns TRUE if undo is available; otherwise returns FALSE.
See the <a href="ntqlineedit.html#undoAvailable-prop">"undoAvailable"</a> property for details.
<h3 class=fn>void <a name="keyPressEvent"></a>TQLineEdit::keyPressEvent ( <a href="qkeyevent.html">TQKeyEvent</a>&nbsp;*&nbsp;e )<tt> [virtual protected]</tt>
</h3>
Converts key press event <em>e</em> into a line edit action.
<p> If Return or Enter is pressed and the current text is valid (or
can be <a href="ntqvalidator.html#fixup">made valid</a> by the
validator), the signal <a href="#returnPressed">returnPressed</a>() is emitted.
<p> The default key bindings are listed in the <a href="#desc">detailed
description.</a>
<p>Reimplemented from <a href="ntqwidget.html#keyPressEvent">TQWidget</a>.
<h3 class=fn>void <a name="lostFocus"></a>TQLineEdit::lostFocus ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the line edit has lost focus.
<p> <p>See also <a href="ntqwidget.html#focus-prop">focus</a>, <a href="ntqwidget.html#focusInEvent">TQWidget::focusInEvent</a>(), and <a href="ntqwidget.html#focusOutEvent">TQWidget::focusOutEvent</a>().
<h3 class=fn>int <a name="maxLength"></a>TQLineEdit::maxLength () const
</h3><p>Returns the maximum permitted length of the text.
See the <a href="ntqlineedit.html#maxLength-prop">"maxLength"</a> property for details.
<h3 class=fn><a href="ntqsize.html">TQSize</a> <a name="minimumSizeHint"></a>TQLineEdit::minimumSizeHint () const<tt> [virtual]</tt>
</h3>
Returns a minimum size for the line edit.
<p> The width returned is enough for at least one character.
<p>Reimplemented from <a href="ntqwidget.html#minimumSizeHint">TQWidget</a>.
<h3 class=fn>void <a name="paste"></a>TQLineEdit::paste ()<tt> [virtual slot]</tt>
</h3>
Inserts the clipboard's text at the cursor position, deleting any
selected text, providing the line edit is not <a href="#readOnly-prop">read-only</a>.
<p> If the end result would not be acceptable to the current
<a href="#setValidator">validator</a>, nothing happens.
<p> <p>See also <a href="#copy">copy</a>() and <a href="#cut">cut</a>().
<h3 class=fn>void <a name="redo"></a>TQLineEdit::redo ()<tt> [virtual slot]</tt>
</h3>
Redoes the last operation if redo is <a href="#redoAvailable-prop">available</a>.
<h3 class=fn>void <a name="returnPressed"></a>TQLineEdit::returnPressed ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the Return or Enter key is pressed.
Note that if there is a <a href="#validator">validator</a>() or <a href="#inputMask">inputMask</a>() set on the line
edit, the <a href="#returnPressed">returnPressed</a>() signal will only be emitted if the input
follows the inputMask() and the validator() returns <tt>Acceptable</tt>.
<p>Example: <a href="popup-example.html#x1610">popup/popup.cpp</a>.
<h3 class=fn>void <a name="selectAll"></a>TQLineEdit::selectAll ()<tt> [virtual slot]</tt>
</h3>
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 deleted.
<p> <p>See also <a href="#setSelection">setSelection</a>() and <a href="#deselect">deselect</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="selectedText"></a>TQLineEdit::selectedText () const
</h3><p>Returns the selected text.
See the <a href="ntqlineedit.html#selectedText-prop">"selectedText"</a> property for details.
<h3 class=fn>void <a name="selectionChanged"></a>TQLineEdit::selectionChanged ()<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the selection changes.
<p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a> and <a href="#selectedText-prop">selectedText</a>.
<h3 class=fn>int <a name="selectionStart"></a>TQLineEdit::selectionStart () const
</h3>
<a href="#selectionStart">selectionStart</a>() returns the index of the first selected character in the
line edit or -1 if no text is selected.
<p> <p>See also <a href="#selectedText-prop">selectedText</a>.
<h3 class=fn>void <a name="setAlignment"></a>TQLineEdit::setAlignment ( int&nbsp;flag )<tt> [virtual slot]</tt>
</h3><p>Sets the alignment of the line edit to <em>flag</em>.
See the <a href="ntqlineedit.html#alignment-prop">"alignment"</a> property for details.
<h3 class=fn>void <a name="setCursorPosition"></a>TQLineEdit::setCursorPosition ( int )<tt> [virtual slot]</tt>
</h3><p>Sets the current cursor position for this line edit.
See the <a href="ntqlineedit.html#cursorPosition-prop">"cursorPosition"</a> property for details.
<h3 class=fn>void <a name="setDragEnabled"></a>TQLineEdit::setDragEnabled ( bool&nbsp;b )<tt> [virtual slot]</tt>
</h3><p>Sets whether the lineedit starts a drag if the user presses and moves the mouse on some selected text to <em>b</em>.
See the <a href="ntqlineedit.html#dragEnabled-prop">"dragEnabled"</a> property for details.
<h3 class=fn>void <a name="setEchoMode"></a>TQLineEdit::setEchoMode ( <a href="ntqlineedit.html#EchoMode-enum">EchoMode</a> )<tt> [virtual slot]</tt>
</h3><p>Sets the line edit's echo mode.
See the <a href="ntqlineedit.html#echoMode-prop">"echoMode"</a> property for details.
<h3 class=fn>void <a name="setEdited"></a>TQLineEdit::setEdited ( bool )
</h3><p>Sets whether the line edit has been edited. Use modified instead.
See the <a href="ntqlineedit.html#edited-prop">"edited"</a> property for details.
<h3 class=fn>void <a name="setFrame"></a>TQLineEdit::setFrame ( bool )<tt> [virtual slot]</tt>
</h3><p>Sets whether the line edit draws itself with a frame.
See the <a href="ntqlineedit.html#frame-prop">"frame"</a> property for details.
<h3 class=fn>void <a name="setInputMask"></a>TQLineEdit::setInputMask ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;inputMask )
</h3><p>Sets the validation input mask to <em>inputMask</em>.
See the <a href="ntqlineedit.html#inputMask-prop">"inputMask"</a> property for details.
<h3 class=fn>void <a name="setMaxLength"></a>TQLineEdit::setMaxLength ( int )<tt> [virtual slot]</tt>
</h3><p>Sets the maximum permitted length of the text.
See the <a href="ntqlineedit.html#maxLength-prop">"maxLength"</a> property for details.
<h3 class=fn>void <a name="setReadOnly"></a>TQLineEdit::setReadOnly ( bool )<tt> [virtual slot]</tt>
</h3><p>Sets whether the line edit is read only.
See the <a href="ntqlineedit.html#readOnly-prop">"readOnly"</a> property for details.
<h3 class=fn>void <a name="setSelection"></a>TQLineEdit::setSelection ( int&nbsp;start, int&nbsp;length )<tt> [virtual slot]</tt>
</h3>
Selects text from position <em>start</em> and for <em>length</em> characters.
<p> Note that this function sets the cursor's position to the end of
the selection regardless of its current position.
<p> <p>See also <a href="#deselect">deselect</a>(), <a href="#selectAll">selectAll</a>(), <a href="#getSelection">getSelection</a>(), <a href="#cursorForward">cursorForward</a>(), and <a href="#cursorBackward">cursorBackward</a>().
<h3 class=fn>void <a name="setText"></a>TQLineEdit::setText ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp; )<tt> [virtual slot]</tt>
</h3><p>Sets the line edit's text.
See the <a href="ntqlineedit.html#text-prop">"text"</a> property for details.
<h3 class=fn>void <a name="setValidator"></a>TQLineEdit::setValidator ( const&nbsp;<a href="ntqvalidator.html">TQValidator</a>&nbsp;*&nbsp;v )<tt> [virtual slot]</tt>
</h3>
Sets this line edit to only accept input that the validator, <em>v</em>,
will accept. This allows you to place any arbitrary constraints on
the text which may be entered.
<p> If <em>v</em> == 0, <a href="#setValidator">setValidator</a>() removes the current input validator.
The initial setting is to have no input validator (i.e. any input
is accepted up to <a href="#maxLength">maxLength</a>()).
<p> <p>See also <a href="#validator">validator</a>(), <a href="qintvalidator.html">TQIntValidator</a>, <a href="qdoublevalidator.html">TQDoubleValidator</a>, and <a href="qregexpvalidator.html">TQRegExpValidator</a>.
<p>Examples: <a href="lineedits-example.html#x180">lineedits/lineedits.cpp</a> and <a href="wizard-example.html#x7">wizard/wizard.cpp</a>.
<h3 class=fn><a href="ntqsize.html">TQSize</a> <a name="sizeHint"></a>TQLineEdit::sizeHint () const<tt> [virtual]</tt>
</h3>
Returns a recommended size for the widget.
<p> The width returned, in pixels, is usually enough for about 15 to
20 characters.
<p>Example: <a href="addressbook-example.html#x583">addressbook/centralwidget.cpp</a>.
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text"></a>TQLineEdit::text () const
</h3><p>Returns the line edit's text.
See the <a href="ntqlineedit.html#text-prop">"text"</a> property for details.
<h3 class=fn>void <a name="textChanged"></a>TQLineEdit::textChanged ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp; )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever the text changes. The argument is
the new text.
<p>Examples: <a href="qaxserver-example-simple.html#x2523">simple/main.cpp</a>, <a href="wizard-example.html#x9">wizard/wizard.cpp</a>, and <a href="xform-example.html#x1231">xform/xform.cpp</a>.
<h3 class=fn>void <a name="undo"></a>TQLineEdit::undo ()<tt> [virtual slot]</tt>
</h3>
Undoes the last operation if undo is <a href="#undoAvailable-prop">available</a>. Deselects any current
selection, and updates the selection start to the current cursor
position.
<h3 class=fn>bool <a name="validateAndSet"></a>TQLineEdit::validateAndSet ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;newText, int&nbsp;newPos, int&nbsp;newMarkAnchor, int&nbsp;newMarkDrag )
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
Use <a href="#setText">setText</a>(), <a href="#setCursorPosition">setCursorPosition</a>() and <a href="#setSelection">setSelection</a>() instead.
<h3 class=fn>const&nbsp;<a href="ntqvalidator.html">TQValidator</a>&nbsp;* <a name="validator"></a>TQLineEdit::validator () const
</h3>
Returns a pointer to the current input validator, or 0 if no
validator has been set.
<p> <p>See also <a href="#setValidator">setValidator</a>().
<p>Example: <a href="wizard-example.html#x10">wizard/wizard.cpp</a>.
<hr><h2>Property Documentation</h2>
<h3 class=fn>bool <a name="acceptableInput-prop"></a>acceptableInput</h3>
<p>This property holds whether the input satisfies the inputMask and the validator.
<p>Get this property's value with <a href="#hasAcceptableInput">hasAcceptableInput</a>().
<p><p>See also <a href="#inputMask-prop">inputMask</a> and <a href="#setValidator">setValidator</a>().
<h3 class=fn>Alignment <a name="alignment-prop"></a>alignment</h3>
<p>This property holds the alignment of the line edit.
<p>Possible Values are <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignAuto</a>, <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignLeft</a>, <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignRight</a> and <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignHCenter</a>.
<p> Attempting to set the alignment to an illegal flag combination
does nothing.
<p> <p>See also <a href="ntqt.html#AlignmentFlags-enum">TQt::AlignmentFlags</a>.
<p>Set this property's value with <a href="#setAlignment">setAlignment</a>() and get this property's value with <a href="#alignment">alignment</a>().
<h3 class=fn>int <a name="cursorPosition-prop"></a>cursorPosition</h3>
<p>This property holds the current cursor position for this line edit.
<p>Setting the cursor position causes a repaint when appropriate.
<p>Set this property's value with <a href="#setCursorPosition">setCursorPosition</a>() and get this property's value with <a href="#cursorPosition">cursorPosition</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="displayText-prop"></a>displayText</h3>
<p>This property holds the displayed text.
<p>If <a href="#EchoMode-enum">EchoMode</a> is <a href="#EchoMode-enum">Normal</a> this returns the same as <a href="#text">text</a>(); if
<a href="#EchoMode-enum">EchoMode</a> is <a href="#EchoMode-enum">Password</a> it returns a string of asterisks
text().length() characters long, e.g. "******"; if <a href="#EchoMode-enum">EchoMode</a> is
<a href="#EchoMode-enum">NoEcho</a> returns an empty string, "".
<p> <p>See also <a href="#echoMode-prop">echoMode</a>, <a href="#text-prop">text</a>, and <a href="#EchoMode-enum">EchoMode</a>.
<p>Get this property's value with <a href="#displayText">displayText</a>().
<h3 class=fn>bool <a name="dragEnabled-prop"></a>dragEnabled</h3>
<p>This property holds whether the lineedit starts a drag if the user presses and moves the mouse on some selected text.
<p>
<p>Set this property's value with <a href="#setDragEnabled">setDragEnabled</a>() and get this property's value with <a href="#dragEnabled">dragEnabled</a>().
<h3 class=fn><a href="ntqlineedit.html#EchoMode-enum">EchoMode</a> <a name="echoMode-prop"></a>echoMode</h3>
<p>This property holds the line edit's echo mode.
<p>The initial setting is <a href="#EchoMode-enum">Normal</a>, but TQLineEdit also supports <a href="#EchoMode-enum">NoEcho</a> and <a href="#EchoMode-enum">Password</a> modes.
<p> The widget's display and the ability to copy or drag the text is
affected by this setting.
<p> <p>See also <a href="#EchoMode-enum">EchoMode</a> and <a href="#displayText-prop">displayText</a>.
<p>Set this property's value with <a href="#setEchoMode">setEchoMode</a>() and get this property's value with <a href="#echoMode">echoMode</a>().
<h3 class=fn>bool <a name="edited-prop"></a>edited</h3>
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> <p>This property holds whether the line edit has been edited. Use modified instead.
<p>
<p>Set this property's value with <a href="#setEdited">setEdited</a>() and get this property's value with <a href="#edited">edited</a>().
<h3 class=fn>bool <a name="frame-prop"></a>frame</h3>
<p>This property holds whether the line edit draws itself with a frame.
<p>If enabled (the default) the line edit draws itself inside a
two-pixel frame, otherwise the line edit draws itself without any
frame.
<p>Set this property's value with <a href="#setFrame">setFrame</a>() and get this property's value with <a href="#frame">frame</a>().
<h3 class=fn>bool <a name="hasSelectedText-prop"></a>hasSelectedText</h3>
<p>This property holds whether there is any text selected.
<p>hasSelectedText() returns TRUE if some or all of the text has been
selected by the user; otherwise returns FALSE.
<p> <p>See also <a href="#selectedText-prop">selectedText</a>.
<p>Get this property's value with <a href="#hasSelectedText">hasSelectedText</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="inputMask-prop"></a>inputMask</h3>
<p>This property holds the validation input mask.
<p>If no mask is set, <a href="#inputMask">inputMask</a>() returns <a href="ntqstring.html#TQString-null">TQString::null</a>.
<p> Sets the TQLineEdit's validation mask. Validators can be used
instead of, or in conjunction with masks; see <a href="#setValidator">setValidator</a>().
<p> Unset the mask and return to normal TQLineEdit operation by passing
an empty string ("") or just calling <a href="#setInputMask">setInputMask</a>() with no
arguments.
<p> The mask format understands these mask characters:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Character <th valign="top">Meaning
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>A</tt> <td valign="top">ASCII alphabetic character required. A-Z, a-z.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>a</tt> <td valign="top">ASCII alphabetic character permitted but not required.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>N</tt> <td valign="top">ASCII alphanumeric character required. A-Z, a-z, 0-9.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>n</tt> <td valign="top">ASCII alphanumeric character permitted but not required.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>X</tt> <td valign="top">Any character required.
<tr bgcolor="#d0d0d0"> <td valign="top"><a href="ntqwidget.html#x-prop">x</a> <td valign="top">Any character permitted but not required.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>9</tt> <td valign="top">ASCII digit required. 0-9.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>0</tt> <td valign="top">ASCII digit permitted but not required.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>D</tt> <td valign="top">ASCII digit required. 1-9.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>d</tt> <td valign="top">ASCII digit permitted but not required (1-9).
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>#</tt> <td valign="top">ASCII digit or plus/minus sign permitted but not required.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&gt;</tt> <td valign="top">All following alphabetic characters are uppercased.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&lt;</tt> <td valign="top">All following alphabetic characters are lowercased.
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>!</tt> <td valign="top">Switch off case conversion.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>&#92;</tt> <td valign="top">Use <tt>&#92;</tt> to escape the special
characters listed above to use them as
separators.
</table></center>
<p> The mask consists of a string of mask characters and separators,
optionally followed by a semi-colon and the character used for
blanks: the blank characters are always removed from the text
after editing. The default blank character is space.
<p> Examples:
<center><table cellpadding="4" cellspacing="2" border="0">
<tr bgcolor="#a2c511"> <th valign="top">Mask <th valign="top">Notes
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>000.000.000.000;_</tt> <td valign="top">IP address; blanks are <tt>_</tt>.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt>0000-00-00</tt> <td valign="top">ISO Date; blanks are <tt>space</tt>
<tr bgcolor="#d0d0d0"> <td valign="top"><tt>&gt;AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#</tt> <td valign="top">License number;
blanks are <tt>-</tt> and all (alphabetic) characters are converted to
uppercase.
</table></center>
<p> To get range control (e.g. for an IP address) use masks together
with <a href="#setValidator">validators</a>.
<p> <p>See also <a href="#maxLength-prop">maxLength</a>.
<p>Set this property's value with <a href="#setInputMask">setInputMask</a>() and get this property's value with <a href="#inputMask">inputMask</a>().
<h3 class=fn>int <a name="maxLength-prop"></a>maxLength</h3>
<p>This property holds the maximum permitted length of the text.
<p>If the text is too long, it is truncated at the limit.
<p> If truncation occurs any selected text will be unselected, the
cursor position is set to 0 and the first part of the string is
shown.
<p> If the line edit has an input mask, the mask defines the maximum
string length.
<p> <p>See also <a href="#inputMask-prop">inputMask</a>.
<p>Set this property's value with <a href="#setMaxLength">setMaxLength</a>() and get this property's value with <a href="#maxLength">maxLength</a>().
<h3 class=fn>bool <a name="modified-prop"></a>modified</h3>
<p>This property holds whether the line edit's contents has been modified by the user.
<p>The modified flag is never read by TQLineEdit; it has a default value
of FALSE and is changed to TRUE whenever the user changes the line
edit's contents.
<p> This is useful for things that need to provide a default value but
do not start out knowing what the default should be (perhaps it
depends on other fields on the form). Start the line edit without
the best default, and when the default is known, if modified()
returns FALSE (the user hasn't entered any text), insert the
default value.
<p> Calling <a href="#clearModified">clearModified</a>() or <a href="#setText">setText</a>() resets the modified flag to
FALSE.
<p>Get this property's value with <a href="#isModified">isModified</a>().
<h3 class=fn>bool <a name="readOnly-prop"></a>readOnly</h3>
<p>This property holds whether the line edit is read only.
<p>In read-only mode, the user can still copy the text to the
clipboard or drag-and-drop the text (if <a href="#echoMode">echoMode</a>() is <a href="#EchoMode-enum">Normal</a>),
but cannot edit it.
<p> TQLineEdit does not show a cursor in read-only mode.
<p> <p>See also <a href="ntqwidget.html#enabled-prop">enabled</a>.
<p>Set this property's value with <a href="#setReadOnly">setReadOnly</a>() and get this property's value with <a href="#isReadOnly">isReadOnly</a>().
<h3 class=fn>bool <a name="redoAvailable-prop"></a>redoAvailable</h3>
<p>This property holds whether redo is available.
<p>
<p>Get this property's value with <a href="#isRedoAvailable">isRedoAvailable</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="selectedText-prop"></a>selectedText</h3>
<p>This property holds the selected text.
<p>If there is no selected text this property's value is
<a href="ntqstring.html#TQString-null">TQString::null</a>.
<p> <p>See also <a href="#hasSelectedText-prop">hasSelectedText</a>.
<p>Get this property's value with <a href="#selectedText">selectedText</a>().
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-prop"></a>text</h3>
<p>This property holds the line edit's text.
<p>Note that setting this property clears the selection, clears the
undo/redo history, moves the cursor to the end of the line and
resets the <a href="#modified-prop">modified</a> property to FALSE. The text is not
validated when inserted with <a href="#setText">setText</a>().
<p> The text is truncated to <a href="#maxLength">maxLength</a>() length.
<p> <p>See also <a href="#insert">insert</a>().
<p>Set this property's value with <a href="#setText">setText</a>() and get this property's value with <a href="#text">text</a>().
<h3 class=fn>bool <a name="undoAvailable-prop"></a>undoAvailable</h3>
<p>This property holds whether undo is available.
<p>
<p>Get this property's value with <a href="#isUndoAvailable">isUndoAvailable</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">TQt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>TQt 3.3.8</div>
</table></div></address></body>
</html>