QLineEdit is a simple line editor, suitable e.g. for asking the user for his name. (details) (complete member list)
#include <qlined.h>
Inherits QWidget.
The default key bindings are described in keyPressEvent(); they cannot be customized except by inheriting the class. When the user clicks on the text, the cursor will be moved to the point being clicked at.
To do:
Creates a new line editor inside widget parent, named name. Both parent and name are as usual - in fact both are passed straight to the QWidget constructor.
This constructor sets the cursor position to the start of the line, the maximum length to 32767 characters, and the current contents of the line to "".
Cleans up when a QLineEdit dies.
If it can delete leftwards, does that and returns TRUE, othewise it returns FALSE
Moves the cursor leftwards one character, restarts the blink timer, and returns TRUE.
Returns FALSE if the cursor is already at the leftmost position.
Moves the cursor rightwards one character, restarts the blink timer, and returns TRUE.
Returns FALSE if the cursor is already at the rightmost position.
Moves the text cursor to the right end of the line, restarts the blink timer, and returns TRUE. Or, if the cursor is already there, returns FALSE.
This event occurs whenever the mouse enters the line editor. It starts the blink timer, etc.
This event occurs whenever the mouse leaves the line editor. It stops the editor's cursor from blinking, etc.
Moves the text cursor to the left end of the line, restarts the blink timer, and returns TRUE. Or, if the cursor is already there, returns FALSE.
This function contains the guts of the line editor.
Here are the default key bindings:
All other keys insert themselves into the line.
To do:
Returns the current maximum length of the text in the editor.
Handles mouse clicks.
At present, this event handler only moves the text cursor to the mouse position and accepts the focus.
To do:
Repaints the line editor as needed. If the line editor is in focus, the line is painted using a pixmap buffer. If not, a faster but flickering drawing method is used.
This event occurs whenever the widget needs repainting.
Paints the line editor quickly, efficently and without the slightest thought about flicker or other bourgeois problems
Paints the line editor slowly, prettily and without flicker
If it can delete rightwards, does that and returns TRUE, othewise it returns FALSE
This event occurs whenever the widget is resized; if necessary it will move the cursor, scroll the text and repaint.
Set the maximum length of the text in the editor. If the text is currently too long, it is chopped off at the limit.
Replaces the text currently in the line with s. If necessary the string is truncated to fit maxLength().
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
convienently be done with a QString object:
QString s = linEd->text(); // makes a copy and stores it in s
This signal is emitted every time the text has changed. The argument is the new text.
This event is used to implement the blinking text cursor.
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: