1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
|
<!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 Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped 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 <<a href="qlineedit-h.html">ntqlineedit.h</a>></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 * parent, const char * name = 0 )</li>
<li class=fn><a href="#TQLineEdit-2"><b>TQLineEdit</b></a> ( const TQString & contents, TQWidget * parent, const char * name = 0 )</li>
<li class=fn><a href="#TQLineEdit-3"><b>TQLineEdit</b></a> ( const TQString & contents, const TQString & inputMask, TQWidget * parent, const char * 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 TQString & newText, int newPos, int newMarkAnchor, int newMarkDrag ) <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 mark, int steps = 1 )</li>
<li class=fn>void <a href="#cursorBackward"><b>cursorBackward</b></a> ( bool mark, int steps = 1 )</li>
<li class=fn>void <a href="#cursorWordForward"><b>cursorWordForward</b></a> ( bool mark )</li>
<li class=fn>void <a href="#cursorWordBackward"><b>cursorWordBackward</b></a> ( bool 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 mark )</li>
<li class=fn>void <a href="#end"><b>end</b></a> ( bool 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 <em>(obsolete)</em></li>
<li class=fn>void setEdited ( bool ) <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 TQString & inputMask )</li>
<li class=fn>bool <a href="#hasAcceptableInput"><b>hasAcceptableInput</b></a> () const</li>
<li class=fn>int characterAt ( int xpos, TQChar * chr ) const <em>(obsolete)</em></li>
<li class=fn>bool getSelection ( int * start, int * end ) <em>(obsolete)</em></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const TQString & )</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 TQString & 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 TQValidator * v )</li>
<li class=fn>virtual void <a href="#setSelection"><b>setSelection</b></a> ( int start, int 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 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 b )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#textChanged"><b>textChanged</b></a> ( const TQString & )</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> - whether the input satisfies the inputMask and the validator <em>(read only)</em></li>
<li class=fn>Alignment <a href="#alignment-prop"><b>alignment</b></a> - the alignment of the line edit</li>
<li class=fn>int <a href="#cursorPosition-prop"><b>cursorPosition</b></a> - the current cursor position for this line edit</li>
<li class=fn>TQString <a href="#displayText-prop"><b>displayText</b></a> - the displayed text <em>(read only)</em></li>
<li class=fn>bool <a href="#dragEnabled-prop"><b>dragEnabled</b></a> - 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> - the line edit's echo mode</li>
<li class=fn>bool edited - whether the line edit has been edited. Use modified instead <em>(obsolete)</em></li>
<li class=fn>bool <a href="#frame-prop"><b>frame</b></a> - whether the line edit draws itself with a frame</li>
<li class=fn>bool <a href="#hasSelectedText-prop"><b>hasSelectedText</b></a> - whether there is any text selected <em>(read only)</em></li>
<li class=fn>TQString <a href="#inputMask-prop"><b>inputMask</b></a> - the validation input mask</li>
<li class=fn>int <a href="#maxLength-prop"><b>maxLength</b></a> - the maximum permitted length of the text</li>
<li class=fn>bool <a href="#modified-prop"><b>modified</b></a> - whether the line edit's contents has been modified by the user <em>(read only)</em></li>
<li class=fn>bool <a href="#readOnly-prop"><b>readOnly</b></a> - whether the line edit is read only</li>
<li class=fn>bool <a href="#redoAvailable-prop"><b>redoAvailable</b></a> - whether redo is available <em>(read only)</em></li>
<li class=fn>TQString <a href="#selectedText-prop"><b>selectedText</b></a> - the selected text <em>(read only)</em></li>
<li class=fn>TQString <a href="#text-prop"><b>text</b></a> - the line edit's text</li>
<li class=fn>bool <a href="#undoAvailable-prop"><b>undoAvailable</b></a> - whether undo is available <em>(read only)</em></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#keyPressEvent"><b>keyPressEvent</b></a> ( TQKeyEvent * 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> * parent, const char * 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 <a href="ntqstring.html">TQString</a> & contents, <a href="ntqwidget.html">TQWidget</a> * parent, const char * 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 <a href="ntqstring.html">TQString</a> & contents, const <a href="ntqstring.html">TQString</a> & inputMask, <a href="ntqwidget.html">TQWidget</a> * parent, const char * 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 xpos, <a href="qchar.html">TQChar</a> * 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> * <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 mark, int 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 mark, int 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 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 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 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 * start, int * 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 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 <a href="ntqstring.html">TQString</a> & 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> * 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 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 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 <a href="ntqstring.html">TQString</a> & 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 start, int 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 <a href="ntqstring.html">TQString</a> & )<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 <a href="ntqvalidator.html">TQValidator</a> * 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 <a href="ntqstring.html">TQString</a> & )<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 <a href="ntqstring.html">TQString</a> & newText, int newPos, int newMarkAnchor, int 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 <a href="ntqvalidator.html">TQValidator</a> * <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>></tt> <td valign="top">All following alphabetic characters are uppercased.
<tr bgcolor="#f0f0f0"> <td valign="top"><tt><</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>\</tt> <td valign="top">Use <tt>\</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>>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 © 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 © 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>
|