The QLineEdit widget is a simple line editor for inputting text. More...
#include <qlined.h>
Inherits QWidget.
The default key bindings are described in keyPressEvent(); they cannot be customized except by inheriting the class.
Examples: widgets/widgets.cpp
Constructs a line editor with an empty edit buffer.
The cursor position is set to the start of the line, the maximum buffer size to 32767 characters, and the buffer contents to "".
The parent and name arguments are sent to the QWidget constructor.
Destroys the line editor.
[virtual protected]
For internal use only.
Reimplemented from QWidget.
[virtual protected]
For internal use only.
Reimplemented from QWidget.
[protected]
Returns TRUE if part of the text has been marked by the user (e.g. by clicking and dragging).
[virtual protected]
The key press event handler converts a key press to some line editor action.
If return or enter is pressed, the signal returnPressed will be emitted.
Here are the default key bindings:
All other keys with valid ASCII codes insert themselves into the line.
Reimplemented from QWidget.
[protected]
Returns the text marked by the user (e.g. by clicking and dragging), or 0 if no text is marked.
See also: hasMarkedText().
Returns the current maximum length of the text in the editor.
See also: setMaxLength().
[virtual protected]
Handles mouse double click events for this widget.
Reimplemented from QWidget.
[virtual protected]
Handles mouse press events for this widget.
Reimplemented from QWidget.
[virtual protected]
Handles mouse release events for this widget.
Reimplemented from QWidget.
[virtual protected]
Handles resize events for this widget.
Reimplemented from QWidget.
[signal]
This signal is emitted when the return or enter key is pressed.
[slot]
Selects all text (i.e. marks it) and does an "end" operation. Useful when a default value has been inserted. If the user types before clicking on the widget the selected text will be erased.
Set the maximum length of the text in the editor. If the text is currently too long, it is chopped off at the limit. Any marked text will be unmarked. The cursor position is set to 0 and the first part of the string is shown.
See also: maxLength().
[slot]
Sets the line editor text to text.
If necessary the text is truncated to fit maxLength().
See also: text().
Returns a pointer to the text currently in the line.
If you need to store the text, you should make a copy of it. This can conveniently be done with a QString object:
QString s = lineEd->text(); // makes a copy and stores it in s
See also: setText().
[signal]
This signal is emitted every time the text has changed. The argument is the new text.
[virtual protected]
For internal use only.
Reimplemented from QObject.
[virtual protected]
This event handler can be reimplemented in a subclass to receive mouse move events for the widget.
If mouse tracking is switched off, mouse move events only occur if a mouse button is down while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is down.
The default implementation does nothing.
See also: setMouseTracking(), mousePressEvent(), mouseReleaseEvent(), mouseDoubleClickEvent(), event() and QMouseEvent.
Reimplemented in QMenuBar, QScrollBar, QComboBox, QListBox, QPopupMenu and QButton.
[virtual protected]
This event handler can be reimplemented in a subclass to receive widget paint events. Actually, it more or less must be reimplemented.
The default implementation does nothing.
When the paint event occurs, the update rectangle QPaintEvent::rect() normally has been cleared to the background color or pixmap. An exception is repaint() with erase=FALSE.
For many widgets it is sufficient to redraw the entire widget each time, but some need to consider the update rectangle to avoid flicker or slow update.
Pixmaps can also be used to implement flicker-free update.
update() and repaint() can be used to force a paint event.
See also: event(), repaint(), update(), QPainter, QPixmap and QPaintEvent.
Reimplemented in QFrame, QComboBox, QScrollBar, QTableView, QPopupMenu, QGroupBox and QButton.
This file is part of the Qt toolkit, copyright © 1995-96 Troll Tech, all rights reserved.
It was generated from the following files: