Qt 4.8
|
#include <qlinecontrol_p.h>
Classes | |
struct | Command |
struct | MaskInputData |
Public Types | |
enum | DrawFlags { DrawText = 0x01, DrawSelections = 0x02, DrawCursor = 0x04, DrawAll = DrawText | DrawSelections | DrawCursor } |
Signals | |
void | accepted () |
void | cursorPositionChanged (int, int) |
void | displayTextChanged (const QString &) |
void | editingFinished () |
void | resetInputContext () |
void | selectionChanged () |
void | textChanged (const QString &) |
void | textEdited (const QString &) |
void | updateMicroFocus () |
void | updateNeeded (const QRect &) |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Public Functions | |
bool | allSelected () const |
int | ascent () const |
void | backspace () |
Handles the behavior for the backspace key or function. More... | |
QString | cancelText () const |
void | clear () |
Clears the line control text. More... | |
void | clearUndo () |
void | complete (int key) |
QCompleter * | completer () const |
bool | composeMode () const |
void | copy (QClipboard::Mode mode=QClipboard::Clipboard) const |
Copies the currently selected text into the clipboard using the given mode. More... | |
int | cursor () const |
int | cursorBlinkPeriod () const |
void | cursorForward (bool mark, int steps) |
Qt::CursorMoveStyle | cursorMoveStyle () const |
int | cursorPosition () const |
QRect | cursorRect () const |
Returns the bounds of the current cursor, as defined as a between characters cursor. More... | |
qreal | cursorToX (int cursor) const |
qreal | cursorToX () const |
int | cursorWidth () const |
void | cursorWordBackward (bool mark) |
void | cursorWordForward (bool mark) |
void | del () |
Handles the behavior for the delete key or function. More... | |
void | deselect () |
QString | displayText () const |
void | draw (QPainter *, const QPoint &, const QRect &, int flags=DrawAll) |
Draws the display text for the line control using the given painter, clip, and offset. More... | |
uint | echoMode () const |
int | end () const |
void | end (bool mark) |
bool | fixup () |
Fixes the current text so that it is valid given any set validators. More... | |
bool | hasAcceptableInput () const |
bool | hasSelectedText () const |
int | height () const |
void | home (bool mark) |
QString | inputMask () const |
bool | inSelection (int x) const |
void | insert (const QString &) |
Inserts the given newText at the current cursor position. More... | |
bool | isModified () const |
bool | isReadOnly () const |
bool | isRedoAvailable () const |
bool | isUndoAvailable () const |
Qt::LayoutDirection | layoutDirection () const |
int | maxLength () const |
void | moveCursor (int pos, bool mark=false) |
Moves the cursor to the given position pos. More... | |
qreal | naturalTextWidth () const |
int | nextMaskBlank (int pos) |
const QPalette & | palette () const |
QChar | passwordCharacter () const |
bool | passwordEchoEditing () const |
void | paste (QClipboard::Mode mode=QClipboard::Clipboard) |
Inserts the text stored in the application clipboard into the line control. More... | |
QString | preeditAreaText () const |
int | preeditCursor () const |
int | prevMaskBlank (int pos) |
bool | processEvent (QEvent *ev) |
void | processInputMethodEvent (QInputMethodEvent *event) |
void | processKeyEvent (QKeyEvent *ev) |
void | processMouseEvent (QMouseEvent *ev) |
QLineControl (const QString &txt=QString()) | |
void | redo () |
void | removeSelection () |
void | resetCursorBlinkTimer () |
void | selectAll () |
QString | selectedText () const |
int | selectionEnd () const |
int | selectionStart () const |
void | selectWordAtPos (int) |
Sets the selection to cover the word at the given cursor position. More... | |
void | setCancelText (const QString &text) |
void | setCompleter (const QCompleter *c) |
void | setCursorBlinkPeriod (int msec) |
void | setCursorMoveStyle (Qt::CursorMoveStyle style) |
void | setCursorPosition (int pos) |
void | setCursorWidth (int value) |
void | setEchoMode (uint mode) |
void | setFont (const QFont &font) |
void | setInputMask (const QString &mask) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setMaxLength (int maxLength) |
void | setModified (bool modified) |
void | setPalette (const QPalette &p) |
void | setPasswordCharacter (const QChar &character) |
void | setPreeditArea (int cursor, const QString &text) |
void | setReadOnly (bool enable) |
void | setSelection (int start, int length) |
Sets length characters from the given start position as selected. More... | |
void | setText (const QString &txt) |
void | setValidator (const QValidator *v) |
int | start () const |
QString | text () const |
QString | textAfterSelection () const |
QString | textBeforeSelection () const |
void | undo () |
void | updatePasswordEchoEditing (bool editing) |
Sets the password echo editing to editing. More... | |
const QValidator * | validator () const |
int | width () const |
int | xToPos (int x, QTextLine::CursorPosition=QTextLine::CursorBetweenCharacters) const |
Returns the cursor position of the given x pixel value in relation to the displayed text. More... | |
~QLineControl () | |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Protected Functions | |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Protected Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
Private Types | |
enum | CommandType { Separator, Insert, Remove, Delete, RemoveSelection, DeleteSelection, SetSelection } |
Private Slots | |
void | _q_clipboardChanged () |
void | _q_deleteSelected () |
Private Functions | |
void | addCommand (const Command &cmd) |
Adds the given command to the undo history of the line control. More... | |
bool | advanceToEnabledItem (int dir) |
void | cancelPasswordEchoTimer () |
QString | clearString (uint pos, uint len) const |
Returns a "cleared" string with only separators and blank chars. More... | |
void | emitCursorPositionChanged () |
If the current cursor position differs from the last emitted cursor position, emits cursorPositionChanged(). More... | |
int | findInMask (int pos, bool forward, bool findSeparator, QChar searchChar=QChar()) const |
bool | finishChange (int validateFromState=-1, bool update=false, bool edited=true) |
Completes a change to the line control text. More... | |
bool | hasAcceptableInput (const QString &text) const |
Returns true if the given text str is valid for any validator or input mask set for the line control. More... | |
void | init (const QString &txt) |
Initializes the line control with a starting text value of txt. More... | |
void | internalDelete (bool wasBackspace=false) |
Also adds the appropriate commands into the undo history. More... | |
void | internalDeselect () |
void | internalInsert (const QString &s) |
Inserts the given string s into the line control. More... | |
void | internalRedo () |
void | internalRemove (int pos) |
void | internalSetText (const QString &txt, int pos=-1, bool edited=true) |
An internal function for setting the text of the line control. More... | |
void | internalUndo (int until=-1) |
bool | isValidInput (QChar key, QChar mask) const |
QString | maskString (uint pos, const QString &str, bool clear=false) const |
Applies the inputMask on str starting from position pos in the mask. More... | |
void | parseInputMask (const QString &maskFields) |
Parses the input mask specified by maskFields to generate the mask data used to handle input masks. More... | |
void | removeSelectedText () |
Also adds the appropriate commands into the undo history. More... | |
void | separate () |
QString | stripString (const QString &str) const |
Strips blank parts of the input in a QLineControl when an inputMask is set, separators are still included. More... | |
void | updateDisplayText (bool forceUpdate=false) |
Properties | |
int | m_ascent |
QChar | m_blank |
int | m_blinkPeriod |
uint | m_blinkStatus: 1 |
int | m_blinkTimer |
QString | m_cancelText |
QPointer< QCompleter > | m_completer |
int | m_cursor |
int | m_cursorWidth |
int | m_deleteAllTimer |
uint | m_dragEnabled: 1 |
uint | m_echoMode: 2 |
uint | m_hideCursor: 1 |
QVector< Command > | m_history |
QString | m_inputMask |
int | m_lastCursorPos |
Qt::LayoutDirection | m_layoutDirection |
MaskInputData * | m_maskData |
int | m_maxLength |
int | m_modifiedState |
QPalette | m_palette |
QChar | m_passwordCharacter |
bool | m_passwordEchoEditing |
int | m_preeditCursor |
uint | m_readOnly: 1 |
uint | m_selDirty: 1 |
int | m_selend |
int | m_selstart |
uint | m_separator: 1 |
QString | m_text |
uint | m_textDirty: 1 |
QTextLayout | m_textLayout |
QList< int > | m_transactions |
QPoint | m_tripleClick |
int | m_tripleClickTimer |
int | m_undoState |
QPointer< QValidator > | m_validator |
uint | m_validInput: 1 |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
Definition at line 77 of file qlinecontrol_p.h.
|
private |
Enumerator | |
---|---|
Separator | |
Insert | |
Remove | |
Delete | |
RemoveSelection | |
DeleteSelection | |
SetSelection |
Definition at line 401 of file qlinecontrol_p.h.
Enumerator | |
---|---|
DrawText | |
DrawSelections | |
DrawCursor | |
DrawAll |
Definition at line 323 of file qlinecontrol_p.h.
Definition at line 82 of file qlinecontrol_p.h.
|
inline |
Definition at line 97 of file qlinecontrol_p.h.
|
privateslot |
|
privateslot |
Definition at line 334 of file qlinecontrol.cpp.
|
signal |
Referenced by processKeyEvent().
|
private |
Adds the given command to the undo history of the line control.
Does not apply the command.
Definition at line 778 of file qlinecontrol.cpp.
Referenced by internalDelete(), internalInsert(), and removeSelectedText().
|
private |
Definition at line 1408 of file qlinecontrol.cpp.
Referenced by complete().
|
inline |
Definition at line 123 of file qlinecontrol_p.h.
|
inline |
Definition at line 128 of file qlinecontrol_p.h.
void QLineControl::backspace | ( | ) |
Handles the behavior for the backspace key or function.
Removes the current selection if there is a selection, otherwise removes the character prior to the cursor position.
Definition at line 204 of file qlinecontrol.cpp.
Referenced by processEvent(), and processKeyEvent().
|
inlineprivate |
Definition at line 437 of file qlinecontrol_p.h.
Referenced by internalDelete(), internalSetText(), internalUndo(), removeSelectedText(), and updatePasswordEchoEditing().
|
inline |
Definition at line 317 of file qlinecontrol_p.h.
void QLineControl::clear | ( | ) |
Clears the line control text.
Definition at line 277 of file qlinecontrol.cpp.
Referenced by internalUndo(), processKeyEvent(), and timerEvent().
Returns a "cleared" string with only separators and blank chars.
Calling this when no inputMask is set is undefined.
Definition at line 1220 of file qlinecontrol.cpp.
Referenced by internalDelete(), internalSetText(), maskString(), and removeSelectedText().
|
inline |
Definition at line 118 of file qlinecontrol_p.h.
void QLineControl::complete | ( | int | key | ) |
Definition at line 1432 of file qlinecontrol.cpp.
Referenced by QLineEditPrivate::_q_textEdited(), and processKeyEvent().
|
inline |
Definition at line 251 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_completionHighlighted(), and QLineEditPrivate::_q_textEdited().
|
inline |
Definition at line 273 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::sendMouseEventToInputContext().
void QLineControl::copy | ( | QClipboard::Mode | mode = QClipboard::Clipboard | ) | const |
Copies the currently selected text into the clipboard using the given mode.
Definition at line 158 of file qlinecontrol.cpp.
Referenced by processKeyEvent(), and processMouseEvent().
|
inline |
Definition at line 162 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_completionHighlighted(), draw(), processKeyEvent(), processMouseEvent(), QLineEditPrivate::sendMouseEventToInputContext(), and updateDisplayText().
|
inline |
Definition at line 313 of file qlinecontrol_p.h.
|
inline |
Definition at line 172 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 168 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 257 of file qlinecontrol_p.h.
|
signal |
Referenced by emitCursorPositionChanged(), and processInputMethodEvent().
QRect QLineControl::cursorRect | ( | ) | const |
Returns the bounds of the current cursor, as defined as a between characters cursor.
Definition at line 403 of file qlinecontrol.cpp.
Referenced by QLineEditPrivate::cursorRect(), setCursorBlinkPeriod(), and timerEvent().
|
inline |
Definition at line 196 of file qlinecontrol_p.h.
|
inline |
Definition at line 197 of file qlinecontrol_p.h.
|
inline |
Definition at line 165 of file qlinecontrol_p.h.
|
inline |
Definition at line 188 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 187 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
void QLineControl::del | ( | ) |
Handles the behavior for the delete key or function.
Removes the current selection if there is a selection, otherwise removes the character after the cursor position.
Definition at line 238 of file qlinecontrol.cpp.
Referenced by processKeyEvent().
|
inline |
Definition at line 218 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_handleWindowActivate(), and processMouseEvent().
|
inline |
Definition at line 214 of file qlinecontrol_p.h.
|
signal |
Referenced by updateDisplayText().
void QLineControl::draw | ( | QPainter * | painter, |
const QPoint & | offset, | ||
const QRect & | clip, | ||
int | flags = DrawAll |
||
) |
Draws the display text for the line control using the given painter, clip, and offset.
Which aspects of the display text are drawn is specified by the given flags.
If the flags contain DrawSelections, then the selection or input mask backgrounds and foregrounds will be applied before drawing the text.
If the flags contain DrawCursor a cursor of the current cursorWidth() will be drawn after drawing the text.
The display text will only be drawn if the flags contain DrawText
Definition at line 608 of file qlinecontrol.cpp.
|
inline |
Definition at line 227 of file qlinecontrol_p.h.
Referenced by complete(), processInputMethodEvent(), and processKeyEvent().
|
signal |
Referenced by processKeyEvent().
|
private |
If the current cursor position differs from the last emitted cursor position, emits cursorPositionChanged().
Definition at line 1393 of file qlinecontrol.cpp.
Referenced by finishChange(), internalRedo(), internalUndo(), moveCursor(), processInputMethodEvent(), and setSelection().
|
inline |
Definition at line 155 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_completionHighlighted(), clearString(), findInMask(), processKeyEvent(), selectWordAtPos(), and stripString().
|
inline |
Definition at line 191 of file qlinecontrol_p.h.
|
private |
Definition at line 1266 of file qlinecontrol.cpp.
Referenced by maskString().
|
private |
Completes a change to the line control text.
If the change is not valid will undo the line control state back to the given validateFromState.
If edited is true and the change is valid, will emit textEdited() in addition to textChanged(). Otherwise only emits textChanged() on a valid change.
The update value is currently unused.
Definition at line 681 of file qlinecontrol.cpp.
Referenced by _q_deleteSelected(), backspace(), clear(), del(), insert(), internalSetText(), and processInputMethodEvent().
bool QLineControl::fixup | ( | ) |
Fixes the current text so that it is valid given any set validators.
Returns true if the text was changed. Otherwise returns false.
Definition at line 426 of file qlinecontrol.cpp.
Referenced by processKeyEvent().
|
inline |
Definition at line 260 of file qlinecontrol_p.h.
Referenced by hasAcceptableInput(), and processKeyEvent().
|
private |
Returns true if the given text str is valid for any validator or input mask set for the line control.
Otherwise returns false
Definition at line 1103 of file qlinecontrol.cpp.
|
inline |
Definition at line 124 of file qlinecontrol_p.h.
Referenced by _q_deleteSelected(), QLineEditPrivate::_q_handleWindowActivate(), QLineEditPrivate::_q_selectionChanged(), backspace(), complete(), del(), internalDelete(), internalInsert(), paste(), and processKeyEvent().
|
inline |
Definition at line 127 of file qlinecontrol_p.h.
|
inline |
Definition at line 190 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
private |
Initializes the line control with a starting text value of txt.
Definition at line 354 of file qlinecontrol.cpp.
|
inline |
Definition at line 263 of file qlinecontrol_p.h.
Referenced by setCursorBlinkPeriod(), QLineEditPrivate::setCursorVisible(), and timerEvent().
|
inline |
Definition at line 139 of file qlinecontrol_p.h.
void QLineControl::insert | ( | const QString & | newText | ) |
Inserts the given newText at the current cursor position.
If there is any selected text it is removed prior to insertion of the new text.
Definition at line 261 of file qlinecontrol.cpp.
Referenced by paste(), processKeyEvent(), and processMouseEvent().
|
private |
Also adds the appropriate commands into the undo history.
deletes a single character from the current text. If wasBackspace, the character prior to the cursor is removed. Otherwise the character after the cursor is removed.
This function does not call finishChange(), and may leave the text in an invalid state.
Definition at line 849 of file qlinecontrol.cpp.
Referenced by backspace(), and del().
|
inlineprivate |
Definition at line 343 of file qlinecontrol_p.h.
Referenced by internalRedo(), internalSetText(), internalUndo(), moveCursor(), and removeSelectedText().
|
private |
Inserts the given string s into the line control.
Also adds the appropriate commands into the undo history. This function does not call finishChange(), and may leave the text in an invalid state.
Definition at line 803 of file qlinecontrol.cpp.
Referenced by insert(), and processInputMethodEvent().
|
private |
Definition at line 1341 of file qlinecontrol.cpp.
|
private |
|
private |
An internal function for setting the text of the line control.
Definition at line 742 of file qlinecontrol.cpp.
Referenced by finishChange(), fixup(), and parseInputMask().
|
private |
Definition at line 1292 of file qlinecontrol.cpp.
Referenced by finishChange().
|
inline |
Definition at line 120 of file qlinecontrol_p.h.
|
inline |
Definition at line 205 of file qlinecontrol_p.h.
Referenced by complete(), QLineEditPrivate::drag(), processEvent(), processKeyEvent(), processMouseEvent(), and QLineEditPrivate::shouldEnableInputMethod().
bool QLineControl::isRedoAvailable | ( | ) | const |
Definition at line 2005 of file qlinecontrol.cpp.
Referenced by internalRedo().
bool QLineControl::isUndoAvailable | ( | ) | const |
Definition at line 1997 of file qlinecontrol.cpp.
Referenced by internalUndo().
checks if the key is valid compared to the inputMask
Definition at line 1023 of file qlinecontrol.cpp.
Referenced by findInMask(), hasAcceptableInput(), and maskString().
|
inline |
Definition at line 291 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
private |
Applies the inputMask on str starting from position pos in the mask.
clear specifies from where characters should be gotten when a separator is met in str - true means that blanks will be used, false that previous input is used. Calling this when no inputMask is set is undefined.
Definition at line 1142 of file qlinecontrol.cpp.
Referenced by internalInsert(), and internalSetText().
|
inline |
Definition at line 236 of file qlinecontrol_p.h.
void QLineControl::moveCursor | ( | int | pos, |
bool | mark = false |
||
) |
Moves the cursor to the given position pos.
If mark is true will adjust the currently selected text.
Definition at line 452 of file qlinecontrol.cpp.
Referenced by QLineEditPrivate::_q_completionHighlighted(), processKeyEvent(), processMouseEvent(), and selectWordAtPos().
|
inline |
Definition at line 129 of file qlinecontrol_p.h.
|
inline |
Definition at line 102 of file qlinecontrol_p.h.
Referenced by internalInsert(), and moveCursor().
|
inline |
Definition at line 320 of file qlinecontrol_p.h.
|
private |
Parses the input mask specified by maskFields to generate the mask data used to handle input masks.
Definition at line 920 of file qlinecontrol.cpp.
|
inline |
Definition at line 288 of file qlinecontrol_p.h.
|
inline |
Definition at line 280 of file qlinecontrol_p.h.
Referenced by processInputMethodEvent(), and processKeyEvent().
void QLineControl::paste | ( | QClipboard::Mode | clipboardMode = QClipboard::Clipboard | ) |
Inserts the text stored in the application clipboard into the line control.
Definition at line 180 of file qlinecontrol.cpp.
Referenced by processKeyEvent().
|
inline |
Definition at line 277 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_selectionChanged(), processInputMethodEvent(), and QLineEditPrivate::sendMouseEventToInputContext().
|
inline |
Definition at line 163 of file qlinecontrol_p.h.
|
inline |
Definition at line 109 of file qlinecontrol_p.h.
Referenced by backspace(), and moveCursor().
bool QLineControl::processEvent | ( | QEvent * | ev | ) |
Definition at line 1520 of file qlinecontrol.cpp.
void QLineControl::processInputMethodEvent | ( | QInputMethodEvent * | event | ) |
Applies the given input method event event to the text of the line control
Definition at line 487 of file qlinecontrol.cpp.
Referenced by processEvent().
void QLineControl::processKeyEvent | ( | QKeyEvent * | ev | ) |
Definition at line 1671 of file qlinecontrol.cpp.
Referenced by processEvent().
void QLineControl::processMouseEvent | ( | QMouseEvent * | ev | ) |
Definition at line 1617 of file qlinecontrol.cpp.
Referenced by processEvent().
|
inline |
Definition at line 224 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
private |
Also adds the appropriate commands into the undo history.
removes the currently selected text from the line control.
This function does not call finishChange(), and may leave the text in an invalid state.
Definition at line 879 of file qlinecontrol.cpp.
Referenced by _q_deleteSelected(), backspace(), clear(), del(), insert(), and processInputMethodEvent().
|
inline |
Definition at line 147 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::drag().
void QLineControl::resetCursorBlinkTimer | ( | ) |
Definition at line 1490 of file qlinecontrol.cpp.
|
signal |
Referenced by _q_deleteSelected(), and internalSetText().
|
inline |
Definition at line 219 of file qlinecontrol_p.h.
Referenced by processKeyEvent(), and processMouseEvent().
|
inline |
Definition at line 133 of file qlinecontrol_p.h.
Referenced by copy(), and QLineEditPrivate::drag().
|
signal |
Referenced by copy(), finishChange(), moveCursor(), processInputMethodEvent(), and setSelection().
|
inline |
|
inline |
void QLineControl::selectWordAtPos | ( | int | cursor | ) |
Sets the selection to cover the word at the given cursor position.
The word boundaries are defined by the behavior of QTextLayout::SkipWords cursor mode.
Definition at line 652 of file qlinecontrol.cpp.
Referenced by processMouseEvent().
|
inlineprivate |
Definition at line 414 of file qlinecontrol_p.h.
Referenced by _q_deleteSelected(), clear(), moveCursor(), paste(), and removeSelectedText().
|
inline |
Definition at line 318 of file qlinecontrol_p.h.
|
inline |
Definition at line 253 of file qlinecontrol_p.h.
void QLineControl::setCursorBlinkPeriod | ( | int | msec | ) |
Definition at line 1472 of file qlinecontrol.cpp.
|
inline |
Definition at line 169 of file qlinecontrol_p.h.
|
inline |
Definition at line 258 of file qlinecontrol_p.h.
|
inline |
Definition at line 166 of file qlinecontrol_p.h.
|
inline |
Definition at line 228 of file qlinecontrol_p.h.
|
inline |
Definition at line 307 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::init().
|
inline |
Definition at line 264 of file qlinecontrol_p.h.
|
inline |
Definition at line 299 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 237 of file qlinecontrol_p.h.
|
inline |
Definition at line 121 of file qlinecontrol_p.h.
|
inline |
Definition at line 321 of file qlinecontrol_p.h.
|
inline |
Definition at line 289 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::init().
|
inline |
Definition at line 274 of file qlinecontrol_p.h.
Referenced by processInputMethodEvent().
|
inline |
Definition at line 206 of file qlinecontrol_p.h.
void QLineControl::setSelection | ( | int | start, |
int | length | ||
) |
Sets length characters from the given start position as selected.
The given start position must be within the current text for the line control. If length characters cannot be selected, then the selection will extend to the end of the current text.
Definition at line 298 of file qlinecontrol.cpp.
Referenced by processKeyEvent().
|
inline |
Definition at line 213 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 247 of file qlinecontrol_p.h.
|
inline |
Definition at line 154 of file qlinecontrol_p.h.
Referenced by advanceToEnabledItem(), and setSelection().
Strips blank parts of the input in a QLineControl when an inputMask is set, separators are still included.
Typically "127.0__.0__.1__" becomes "127.0.0.1".
Definition at line 1245 of file qlinecontrol.cpp.
|
inline |
Definition at line 208 of file qlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_completionHighlighted(), complete(), finishChange(), processKeyEvent(), and processMouseEvent().
|
inline |
Definition at line 135 of file qlinecontrol_p.h.
Referenced by complete(), and processKeyEvent().
|
inline |
Definition at line 134 of file qlinecontrol_p.h.
Referenced by complete().
|
signal |
Referenced by finishChange().
|
signal |
Referenced by finishChange().
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive timer events for the object.
QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.
Reimplemented from QObject.
Definition at line 1499 of file qlinecontrol.cpp.
|
inline |
Definition at line 223 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
private |
Updates the display text based of the current edit text If the text has changed will emit displayTextChanged()
Definition at line 87 of file qlinecontrol.cpp.
Referenced by finishChange(), init(), moveCursor(), processInputMethodEvent(), timerEvent(), and updatePasswordEchoEditing().
|
signal |
Referenced by finishChange(), and processInputMethodEvent().
|
signal |
Referenced by setCursorBlinkPeriod(), and timerEvent().
void QLineControl::updatePasswordEchoEditing | ( | bool | editing | ) |
Sets the password echo editing to editing.
If password echo editing is true, then the text of the password is displayed even if the echo mode is set to QLineEdit::PasswordEchoOnEdit. Password echoing editing does not affect other echo modes.
Definition at line 372 of file qlinecontrol.cpp.
Referenced by processInputMethodEvent(), processKeyEvent(), and QLineEditPrivate::updatePasswordEchoEditing().
|
inline |
Definition at line 246 of file qlinecontrol_p.h.
|
inline |
Definition at line 126 of file qlinecontrol_p.h.
int QLineControl::xToPos | ( | int | x, |
QTextLine::CursorPosition | betweenOrOn = QTextLine::CursorBetweenCharacters |
||
) | const |
Returns the cursor position of the given x pixel value in relation to the displayed text.
The given betweenOrOn specified what kind of cursor position is requested.
Definition at line 389 of file qlinecontrol.cpp.
Referenced by processMouseEvent(), and QLineEditPrivate::xToPos().
|
private |
Definition at line 370 of file qlinecontrol_p.h.
Referenced by updateDisplayText().
|
private |
Definition at line 397 of file qlinecontrol_p.h.
Referenced by clearString(), isValidInput(), parseInputMask(), and stripString().
|
private |
Definition at line 367 of file qlinecontrol_p.h.
Referenced by draw(), resetCursorBlinkTimer(), and setCursorBlinkPeriod().
|
private |
Definition at line 366 of file qlinecontrol_p.h.
Referenced by draw(), resetCursorBlinkTimer(), setCursorBlinkPeriod(), and timerEvent().
|
private |
Definition at line 368 of file qlinecontrol_p.h.
Referenced by resetCursorBlinkTimer(), setCursorBlinkPeriod(), and timerEvent().
|
private |
Definition at line 376 of file qlinecontrol_p.h.
Referenced by processKeyEvent().
|
private |
Definition at line 385 of file qlinecontrol_p.h.
Referenced by advanceToEnabledItem(), complete(), and processKeyEvent().
|
private |
Definition at line 354 of file qlinecontrol_p.h.
Referenced by addCommand(), backspace(), cursorRect(), del(), draw(), emitCursorPositionChanged(), finishChange(), fixup(), hasAcceptableInput(), init(), internalDelete(), internalInsert(), internalRedo(), internalSetText(), internalUndo(), moveCursor(), processInputMethodEvent(), removeSelectedText(), setSelection(), and updateDisplayText().
|
private |
Definition at line 356 of file qlinecontrol_p.h.
Referenced by cursorRect(), and draw().
|
private |
Definition at line 369 of file qlinecontrol_p.h.
Referenced by processEvent(), processKeyEvent(), and timerEvent().
|
private |
Definition at line 361 of file qlinecontrol_p.h.
|
private |
Definition at line 362 of file qlinecontrol_p.h.
Referenced by copy(), internalInsert(), internalUndo(), isRedoAvailable(), isUndoAvailable(), and updateDisplayText().
|
private |
Definition at line 358 of file qlinecontrol_p.h.
Referenced by draw(), and processInputMethodEvent().
Definition at line 411 of file qlinecontrol_p.h.
Referenced by addCommand(), finishChange(), internalRedo(), internalSetText(), internalUndo(), isRedoAvailable(), and isUndoAvailable().
|
private |
Definition at line 396 of file qlinecontrol_p.h.
Referenced by parseInputMask().
|
private |
Definition at line 372 of file qlinecontrol_p.h.
Referenced by emitCursorPositionChanged(), and finishChange().
|
private |
Definition at line 357 of file qlinecontrol_p.h.
Referenced by updateDisplayText().
|
private |
Definition at line 398 of file qlinecontrol_p.h.
Referenced by backspace(), clearString(), findInMask(), hasAcceptableInput(), internalDelete(), internalInsert(), internalSetText(), maskString(), moveCursor(), parseInputMask(), removeSelectedText(), and stripString().
|
private |
Definition at line 371 of file qlinecontrol_p.h.
Referenced by clearString(), findInMask(), hasAcceptableInput(), internalInsert(), internalSetText(), maskString(), parseInputMask(), and stripString().
|
private |
Definition at line 409 of file qlinecontrol_p.h.
Referenced by finishChange(), and internalSetText().
|
private |
Definition at line 353 of file qlinecontrol_p.h.
Referenced by draw().
|
private |
Definition at line 433 of file qlinecontrol_p.h.
Referenced by updateDisplayText().
|
private |
Definition at line 432 of file qlinecontrol_p.h.
Referenced by updateDisplayText(), and updatePasswordEchoEditing().
|
private |
Definition at line 355 of file qlinecontrol_p.h.
Referenced by cursorRect(), draw(), and processInputMethodEvent().
|
private |
Definition at line 360 of file qlinecontrol_p.h.
Referenced by isRedoAvailable(), and isUndoAvailable().
|
private |
Definition at line 364 of file qlinecontrol_p.h.
Referenced by finishChange(), and moveCursor().
|
private |
Definition at line 418 of file qlinecontrol_p.h.
Referenced by addCommand(), clear(), draw(), internalDelete(), internalInsert(), internalRedo(), internalUndo(), moveCursor(), processInputMethodEvent(), removeSelectedText(), and setSelection().
|
private |
Definition at line 417 of file qlinecontrol_p.h.
Referenced by addCommand(), clear(), draw(), internalDelete(), internalInsert(), internalRedo(), internalUndo(), moveCursor(), processInputMethodEvent(), removeSelectedText(), and setSelection().
|
private |
Definition at line 359 of file qlinecontrol_p.h.
Referenced by addCommand().
|
private |
Definition at line 352 of file qlinecontrol_p.h.
Referenced by backspace(), clear(), finishChange(), fixup(), init(), internalDelete(), internalInsert(), internalRedo(), internalSetText(), internalUndo(), maskString(), parseInputMask(), processInputMethodEvent(), removeSelectedText(), selectWordAtPos(), setSelection(), and updateDisplayText().
|
private |
Definition at line 363 of file qlinecontrol_p.h.
Referenced by finishChange(), internalDelete(), internalInsert(), internalRedo(), internalSetText(), internalUndo(), and removeSelectedText().
|
private |
Definition at line 430 of file qlinecontrol_p.h.
Referenced by cursorRect(), del(), draw(), processInputMethodEvent(), selectWordAtPos(), updateDisplayText(), and xToPos().
|
private |
Definition at line 373 of file qlinecontrol_p.h.
Referenced by finishChange().
|
private |
Definition at line 374 of file qlinecontrol_p.h.
Referenced by processMouseEvent().
|
private |
Definition at line 375 of file qlinecontrol_p.h.
Referenced by processMouseEvent(), and timerEvent().
|
private |
Definition at line 410 of file qlinecontrol_p.h.
Referenced by _q_deleteSelected(), addCommand(), backspace(), clear(), del(), finishChange(), insert(), internalRedo(), internalSetText(), internalUndo(), isRedoAvailable(), isUndoAvailable(), and processInputMethodEvent().
|
private |
Definition at line 383 of file qlinecontrol_p.h.
Referenced by finishChange(), fixup(), and hasAcceptableInput().
|
private |
Definition at line 365 of file qlinecontrol_p.h.
Referenced by finishChange().