![]() |
Qt 6.x
The Qt SDK
|
#include <qwidgetlinecontrol_p.h>
Public Types | |
enum | DrawFlags { DrawText = 0x01 , DrawSelections = 0x02 , DrawCursor = 0x04 , DrawAll = DrawText | DrawSelections | DrawCursor } |
![]() | |
enum | Type { LineEdit , TextEdit } |
Signals | |
void | cursorPositionChanged (int, int) |
void | selectionChanged () |
void | displayTextChanged (const QString &) |
void | textChanged (const QString &) |
void | textEdited (const QString &) |
void | resetInputContext () |
void | updateMicroFocus () |
void | accepted () |
void | editingFinished () |
void | updateNeeded (const QRect &) |
void | inputRejected () |
![]() | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QWidgetLineControl (const QString &txt=QString()) | |
~QWidgetLineControl () | |
void | setAccessibleObject (QObject *object) |
QObject * | accessibleObject () |
int | nextMaskBlank (int pos) |
int | prevMaskBlank (int pos) |
bool | isUndoAvailable () const |
bool | isRedoAvailable () const |
void | clearUndo () |
bool | isModified () const |
void | setModified (bool modified) |
bool | allSelected () const |
bool | hasSelectedText () const |
int | width () const |
int | height () const |
int | ascent () const |
qreal | naturalTextWidth () const |
void | setSelection (int start, int length) |
QString | selectedText () const |
QString | textBeforeSelection () const |
QString | textAfterSelection () const |
int | selectionStart () const |
int | selectionEnd () const |
bool | inSelection (int x) const |
void | removeSelection () |
int | start () const |
int | end () const |
void | copy (QClipboard::Mode mode=QClipboard::Clipboard) const |
void | paste (QClipboard::Mode mode=QClipboard::Clipboard) |
int | cursor () const |
int | preeditCursor () const |
int | cursorWidth () const |
void | setCursorWidth (int value) |
Qt::CursorMoveStyle | cursorMoveStyle () const |
void | setCursorMoveStyle (Qt::CursorMoveStyle style) |
void | moveCursor (int pos, bool mark=false) |
void | cursorForward (bool mark, int steps) |
void | cursorWordForward (bool mark) |
void | cursorWordBackward (bool mark) |
void | home (bool mark) |
void | end (bool mark) |
int | xToPos (int x, QTextLine::CursorPosition=QTextLine::CursorBetweenCharacters) const |
QRect | rectForPos (int pos) const |
QRect | cursorRect () const |
QRect | anchorRect () const |
qreal | cursorToX (int cursor) const |
qreal | cursorToX () const |
bool | isReadOnly () const |
void | setReadOnly (bool enable) |
QString | text () const |
void | setText (const QString &txt) |
void | commitPreedit () |
QString | displayText () const |
QString | surroundingText () const |
void | backspace () |
void | del () |
void | deselect () |
void | selectAll () |
void | insert (const QString &) |
void | clear () |
void | undo () |
void | redo () |
void | selectWordAtPos (int) |
uint | echoMode () const |
void | setEchoMode (uint mode) |
int | maxLength () const |
void | setMaxLength (int maxLength) |
const QValidator * | validator () const |
void | setValidator (const QValidator *v) |
int | cursorPosition () const |
void | setCursorPosition (int pos) |
bool | hasAcceptableInput () const |
bool | fixup () |
QString | inputMask () const |
void | setInputMask (const QString &mask) |
bool | composeMode () const |
void | setPreeditArea (int cursor, const QString &text) |
QString | preeditAreaText () const |
void | updatePasswordEchoEditing (bool editing) |
bool | passwordEchoEditing () const |
QChar | passwordCharacter () const |
void | setPasswordCharacter (QChar character) |
int | passwordMaskDelay () const |
void | setPasswordMaskDelay (int delay) |
Qt::LayoutDirection | layoutDirection () const |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setFont (const QFont &font) |
void | processInputMethodEvent (QInputMethodEvent *event) |
void | processKeyEvent (QKeyEvent *ev) |
void | setBlinkingCursorEnabled (bool enable) |
void | updateCursorBlinking () |
void | resetCursorBlinkTimer () |
bool | cursorBlinkStatus () const |
QString | cancelText () const |
void | setCancelText (const QString &text) |
const QPalette & | palette () const |
void | setPalette (const QPalette &p) |
void | draw (QPainter *, const QPoint &, const QRect &, int flags=DrawAll) |
void | processShortcutOverrideEvent (QKeyEvent *ke) |
QTextLayout * | textLayout () const |
![]() | |
QInputControl (Type type, QObject *parent=nullptr) | |
bool | isAcceptableInput (const QKeyEvent *event) const |
![]() | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | event (QEvent *event) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
template<typename T > | |
T | findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) 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. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
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 . | |
Protected Member Functions | |
virtual void | timerEvent (QTimerEvent *event) override |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
![]() | |
QInputControl (Type type, QObjectPrivate &dd, QObject *parent=nullptr) | |
![]() | |
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 \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Additional Inherited Members | |
![]() | |
void | deleteLater () |
\threadsafe | |
![]() | |
static bool | isCommonTextEditShortcut (const QKeyEvent *ke) |
![]() | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
![]() | |
QScopedPointer< QObjectData > | d_ptr |
![]() | |
QString | objectName |
the name of this object | |
![]() | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Definition at line 50 of file qwidgetlinecontrol_p.h.
Enumerator | |
---|---|
DrawText | |
DrawSelections | |
DrawCursor | |
DrawAll |
Definition at line 355 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 75 of file qwidgetlinecontrol_p.h.
References QString::fill(), and QLineEdit::Normal.
|
signal |
|
inline |
Definition at line 90 of file qwidgetlinecontrol_p.h.
References QObject::parent().
|
inline |
Definition at line 118 of file qwidgetlinecontrol_p.h.
References QString::isEmpty(), and QString::size().
QRect QWidgetLineControl::anchorRect | ( | ) | const |
Returns the bounds of the current anchor
Definition at line 404 of file qwidgetlinecontrol.cpp.
References cursorRect(), hasSelectedText(), and rectForPos().
|
inline |
Definition at line 123 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::adjustedControlRect().
void QWidgetLineControl::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 174 of file qwidgetlinecontrol.cpp.
References QString::at(), hasSelectedText(), QChar::isHighSurrogate(), QChar::isLowSurrogate(), and prevMaskBlank().
Referenced by processKeyEvent().
|
inline |
Definition at line 349 of file qwidgetlinecontrol_p.h.
void QWidgetLineControl::clear | ( | ) |
Clears the line control text.
Definition at line 240 of file qwidgetlinecontrol.cpp.
References QString::size().
Referenced by processKeyEvent(), timerEvent(), and undo().
|
inline |
Definition at line 113 of file qwidgetlinecontrol_p.h.
void QWidgetLineControl::commitPreedit | ( | ) |
Definition at line 147 of file qwidgetlinecontrol.cpp.
References QTextLayout::clearFormats(), QInputMethod::commit(), composeMode(), QGuiApplication::inputMethod(), and setPreeditArea().
Referenced by moveCursor(), and setSelection().
|
inline |
Definition at line 306 of file qwidgetlinecontrol_p.h.
Referenced by commitPreedit(), and QLineEditPrivate::sendMouseEventToInputContext().
void QWidgetLineControl::copy | ( | QClipboard::Mode | mode = QClipboard::Clipboard | ) | const |
Copies the currently selected text into the clipboard using the given mode.
Definition at line 116 of file qwidgetlinecontrol.cpp.
References QGuiApplication::clipboard(), QLineEdit::Normal, selectedText(), and QClipboard::setText().
Referenced by processKeyEvent().
|
inline |
Definition at line 160 of file qwidgetlinecontrol_p.h.
Referenced by draw(), processKeyEvent(), selectWordAtPos(), and QLineEditPrivate::sendMouseEventToInputContext().
|
inline |
Definition at line 347 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 170 of file qwidgetlinecontrol_p.h.
References Qt::VisualMoveStyle.
Referenced by processKeyEvent().
|
inline |
Definition at line 166 of file qwidgetlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 279 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_selectionChanged().
|
signal |
QRect QWidgetLineControl::cursorRect | ( | ) | const |
Returns the bounds of the current cursor, as defined as a between characters cursor.
Definition at line 394 of file qwidgetlinecontrol.cpp.
References rectForPos().
Referenced by anchorRect(), QLineEditPrivate::cursorRect(), timerEvent(), and updateCursorBlinking().
|
inline |
Definition at line 197 of file qwidgetlinecontrol_p.h.
References cursor.
|
inline |
Definition at line 196 of file qwidgetlinecontrol_p.h.
References cursor.
|
inline |
Definition at line 163 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 186 of file qwidgetlinecontrol_p.h.
References QTextLayout::SkipWords.
Referenced by processKeyEvent().
|
inline |
Definition at line 185 of file qwidgetlinecontrol_p.h.
References QTextLayout::SkipWords.
Referenced by processKeyEvent().
void QWidgetLineControl::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 207 of file qwidgetlinecontrol.cpp.
References hasSelectedText(), QTextLayout::nextCursorPosition(), and textLayout().
Referenced by processKeyEvent().
|
inline |
Definition at line 233 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_handleWindowActivate().
|
inline |
Definition at line 224 of file qwidgetlinecontrol_p.h.
void QWidgetLineControl::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 605 of file qwidgetlinecontrol.cpp.
References QList< T >::append(), QPalette::brush(), cursor(), QTextLayout::draw(), QTextLayout::drawCursor(), DrawCursor, DrawSelections, DrawText, QPalette::Highlight, QPalette::HighlightedText, o, painter, QPalette::Text, textLayout(), and QPalette::Window.
|
inline |
Definition at line 242 of file qwidgetlinecontrol_p.h.
Referenced by processInputMethodEvent(), and processKeyEvent().
|
signal |
|
inline |
Definition at line 153 of file qwidgetlinecontrol_p.h.
References QString::size().
Referenced by processKeyEvent(), and selectWordAtPos().
|
inline |
Definition at line 189 of file qwidgetlinecontrol_p.h.
References QString::size().
bool QWidgetLineControl::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 418 of file qwidgetlinecontrol.cpp.
References QValidator::Acceptable, QValidator::fixup(), and QValidator::validate().
Referenced by processKeyEvent().
|
inline |
Definition at line 282 of file qwidgetlinecontrol_p.h.
References hasAcceptableInput().
Referenced by hasAcceptableInput(), and processKeyEvent().
|
inline |
Definition at line 119 of file qwidgetlinecontrol_p.h.
References QString::isEmpty().
Referenced by QLineEditPrivate::_q_handleWindowActivate(), QLineEditPrivate::_q_selectionChanged(), anchorRect(), backspace(), del(), paste(), and processKeyEvent().
|
inline |
Definition at line 122 of file qwidgetlinecontrol_p.h.
References qRound().
|
inline |
Definition at line 188 of file qwidgetlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 285 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::setCursorVisible(), timerEvent(), and updateCursorBlinking().
|
signal |
|
inline |
Definition at line 137 of file qwidgetlinecontrol_p.h.
References QTextLine::CursorOnCharacter, and pos.
Referenced by QLineEditPrivate::inSelection().
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 227 of file qwidgetlinecontrol.cpp.
Referenced by paste(), and processKeyEvent().
|
inline |
Definition at line 115 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 205 of file qwidgetlinecontrol_p.h.
Referenced by processKeyEvent(), processShortcutOverrideEvent(), and QLineEditPrivate::shouldEnableInputMethod().
bool QWidgetLineControl::isRedoAvailable | ( | ) | const |
Definition at line 1942 of file qwidgetlinecontrol.cpp.
References QLineEdit::Normal.
bool QWidgetLineControl::isUndoAvailable | ( | ) | const |
Definition at line 1934 of file qwidgetlinecontrol.cpp.
References QLineEdit::Normal.
|
inline |
Definition at line 325 of file qwidgetlinecontrol_p.h.
References QString::isEmpty(), QString::isRightToLeft(), Qt::LayoutDirectionAuto, Qt::LeftToRight, and Qt::RightToLeft.
Referenced by processKeyEvent().
|
inline |
Definition at line 258 of file qwidgetlinecontrol_p.h.
Moves the cursor to the given position pos. If mark is true will adjust the currently selected text.
Definition at line 441 of file qwidgetlinecontrol.cpp.
References commitPreedit(), emit, nextMaskBlank(), pos, prevMaskBlank(), qMax(), qMin(), and selectionChanged().
Referenced by processKeyEvent(), and selectWordAtPos().
|
inline |
Definition at line 124 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 97 of file qwidgetlinecontrol_p.h.
References pos.
Referenced by moveCursor().
|
inline |
Definition at line 352 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 319 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 313 of file qwidgetlinecontrol_p.h.
Referenced by processInputMethodEvent(), and processKeyEvent().
|
inline |
Definition at line 322 of file qwidgetlinecontrol_p.h.
void QWidgetLineControl::paste | ( | QClipboard::Mode | clipboardMode = QClipboard::Clipboard | ) |
Inserts the text stored in the application clipboard into the line control.
Definition at line 132 of file qwidgetlinecontrol.cpp.
References QGuiApplication::clipboard(), hasSelectedText(), insert(), QString::isEmpty(), and QClipboard::text().
Referenced by processKeyEvent().
|
inline |
Definition at line 310 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_selectionChanged(), processInputMethodEvent(), QLineEditPrivate::sendMouseEventToInputContext(), and QLineEditPrivate::shouldShowPlaceholderText().
|
inline |
Definition at line 161 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 104 of file qwidgetlinecontrol_p.h.
References pos.
Referenced by backspace(), and moveCursor().
void QWidgetLineControl::processInputMethodEvent | ( | QInputMethodEvent * | event | ) |
Applies the given input method event event to the text of the line control
Definition at line 478 of file qwidgetlinecontrol.cpp.
References QInputMethodEvent::Cursor, cursorPositionChanged(), echoMode(), emit, QString::fill(), i, QLineEdit::NoEcho, o, QLineEdit::Password, passwordEchoEditing(), QLineEdit::PasswordEchoOnEdit, preeditAreaText(), qBound(), qMax(), qMin(), qSwap(), QInputMethodEvent::Selection, selectionChanged(), QTextLayout::setFormats(), setPreeditArea(), QString::size(), QInputMethodEvent::TextFormat, QTextFormat::toCharFormat(), updateMicroFocus(), and updatePasswordEchoEditing().
Definition at line 1605 of file qwidgetlinecontrol.cpp.
References accepted(), Qt::AltModifier, backspace(), clear(), QClipboard::Clipboard, QGuiApplication::clipboard(), QInputMethod::commit(), QCompleter::completionMode, QCompleter::completionPrefix, Qt::ControlModifier, QKeySequence::Copy, copy(), Qt::CTRL, QCompleter::currentCompletion(), cursor(), cursorForward(), cursorMoveStyle(), cursorWordBackward(), cursorWordForward(), QKeySequence::Cut, del(), QKeySequence::Delete, QKeySequence::DeleteCompleteLine, QKeySequence::DeleteEndOfLine, QKeySequence::DeleteEndOfWord, QKeySequence::DeleteStartOfWord, echoMode(), editingFinished(), emit, end(), fixup(), QCompleterPrivate::get(), hasAcceptableInput(), hasSelectedText(), QInputMethod::hide(), home(), Qt::ImhMultiLine, QCompleter::InlineCompletion, QGuiApplication::inputMethod(), QWidget::inputMethodHints, insert(), QInputControl::isAcceptableInput(), QString::isEmpty(), isReadOnly(), Qt::Key_Back, Qt::Key_Backspace, Qt::Key_Direction_L, Qt::Key_Direction_R, Qt::Key_Down, Qt::Key_Enter, Qt::Key_Escape, Qt::Key_F4, Qt::Key_Insert, Qt::Key_Return, Qt::Key_Select, Qt::Key_Up, layoutDirection(), Qt::LeftToRight, lineEdit, QPlatformTheme::MacKeyboardScheme, moveCursor(), QKeySequence::MoveToEndOfBlock, QKeySequence::MoveToEndOfLine, QKeySequence::MoveToNextChar, QKeySequence::MoveToNextWord, QKeySequence::MoveToPreviousChar, QKeySequence::MoveToPreviousWord, QKeySequence::MoveToStartOfBlock, QKeySequence::MoveToStartOfLine, Qt::NoModifier, QLineEdit::Normal, QObject::parent(), passwordEchoEditing(), QLineEdit::PasswordEchoOnEdit, QKeySequence::Paste, paste(), QCompleterPrivate::popup, QCompleter::PopupCompletion, qobject_cast< QWidget * >(), QKeySequence::Redo, redo(), Qt::RightToLeft, QKeySequence::SelectAll, selectAll(), QKeySequence::SelectEndOfBlock, QKeySequence::SelectEndOfLine, QClipboard::Selection, selectionEnd(), selectionStart(), QKeySequence::SelectNextChar, QKeySequence::SelectNextWord, QKeySequence::SelectPreviousChar, QKeySequence::SelectPreviousWord, QKeySequence::SelectStartOfBlock, QKeySequence::SelectStartOfLine, setLayoutDirection(), setSelection(), setText(), Qt::SHIFT, Qt::ShiftModifier, QObject::startTimer(), text(), textAfterSelection(), QKeySequence::Undo, undo(), QCompleter::UnfilteredPopupCompletion, unknown, updatePasswordEchoEditing(), Qt::VisualMoveStyle, QPlatformTheme::WindowsKeyboardScheme, and QPlatformTheme::X11KeyboardScheme.
Definition at line 1551 of file qwidgetlinecontrol.cpp.
References QEvent::accept(), QKeySequence::Copy, QKeySequence::Cut, QKeySequence::DeleteCompleteLine, isReadOnly(), QKeyEvent::key(), Qt::Key_Backspace, Qt::Key_Delete, Qt::Key_End, Qt::Key_Escape, Qt::Key_Home, Qt::Key_Left, Qt::Key_Right, Qt::KeypadModifier, QKeyEvent::modifiers(), QKeySequence::MoveToEndOfDocument, QKeySequence::MoveToEndOfLine, QKeySequence::MoveToNextWord, QKeySequence::MoveToPreviousWord, QKeySequence::MoveToStartOfDocument, QKeySequence::MoveToStartOfLine, Qt::NoModifier, QKeySequence::Paste, QKeySequence::Redo, QKeySequence::SelectAll, QKeySequence::SelectEndOfBlock, QKeySequence::SelectEndOfDocument, QKeySequence::SelectEndOfLine, QKeySequence::SelectNextWord, QKeySequence::SelectPreviousWord, QKeySequence::SelectStartOfBlock, QKeySequence::SelectStartOfDocument, QKeySequence::SelectStartOfLine, Qt::ShiftModifier, and QKeySequence::Undo.
QRect QWidgetLineControl::rectForPos | ( | int | pos | ) | const |
Returns the bounds of the given text position.
Definition at line 376 of file qwidgetlinecontrol.cpp.
References ch, QTextLine::cursorToX(), QTextLine::height(), QTextLayout::lineAt(), pos, qRound(), and textLayout().
Referenced by anchorRect(), and cursorRect().
|
inline |
Definition at line 239 of file qwidgetlinecontrol_p.h.
Referenced by processKeyEvent().
|
inline |
Definition at line 145 of file qwidgetlinecontrol_p.h.
void QWidgetLineControl::resetCursorBlinkTimer | ( | ) |
Definition at line 1519 of file qwidgetlinecontrol.cpp.
References QStyleHints::cursorFlashTime, QObject::killTimer(), QObject::startTimer(), and QGuiApplication::styleHints().
|
signal |
|
inline |
Definition at line 234 of file qwidgetlinecontrol_p.h.
References QString::size().
Referenced by processKeyEvent().
|
inline |
Definition at line 128 of file qwidgetlinecontrol_p.h.
References QString::mid().
Referenced by copy().
|
signal |
Referenced by moveCursor(), processInputMethodEvent(), and setSelection().
|
inline |
Definition at line 133 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_selectionChanged(), and processKeyEvent().
|
inline |
Definition at line 132 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::_q_selectionChanged(), and processKeyEvent().
void QWidgetLineControl::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 646 of file qwidgetlinecontrol.cpp.
References cursor(), end(), moveCursor(), next, QTextLayout::nextCursorPosition(), QTextLayout::previousCursorPosition(), QTextLayout::SkipWords, and textLayout().
Definition at line 84 of file qwidgetlinecontrol_p.h.
References Q_ASSERT.
void QWidgetLineControl::setBlinkingCursorEnabled | ( | bool | enable | ) |
Definition at line 1486 of file qwidgetlinecontrol.cpp.
References QObject::connect(), QStyleHints::cursorFlashTimeChanged(), disconnect(), QGuiApplication::styleHints(), and updateCursorBlinking().
Definition at line 350 of file qwidgetlinecontrol_p.h.
References text.
|
inline |
Definition at line 167 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 280 of file qwidgetlinecontrol_p.h.
References pos, qMax(), and QString::size().
|
inline |
Definition at line 164 of file qwidgetlinecontrol_p.h.
Definition at line 243 of file qwidgetlinecontrol_p.h.
References QLineEdit::Normal, and QString::reserve().
Definition at line 338 of file qwidgetlinecontrol_p.h.
References font.
Referenced by QLineEditPrivate::init().
Definition at line 297 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 330 of file qwidgetlinecontrol_p.h.
References direction.
Referenced by processKeyEvent().
|
inline |
Definition at line 259 of file qwidgetlinecontrol_p.h.
References setText().
|
inline |
Definition at line 116 of file qwidgetlinecontrol_p.h.
Definition at line 353 of file qwidgetlinecontrol_p.h.
Definition at line 320 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::init().
|
inline |
Definition at line 323 of file qwidgetlinecontrol_p.h.
Referenced by QLineEditPrivate::init().
Definition at line 307 of file qwidgetlinecontrol_p.h.
Referenced by commitPreedit(), and processInputMethodEvent().
void QWidgetLineControl::setReadOnly | ( | bool | enable | ) |
Definition at line 1477 of file qwidgetlinecontrol.cpp.
References updateCursorBlinking().
void QWidgetLineControl::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 275 of file qwidgetlinecontrol.cpp.
References commitPreedit(), emit, Q_UNLIKELY, qMax(), qMin(), qWarning, selectionChanged(), QString::size(), and start().
Referenced by processKeyEvent().
Definition at line 214 of file qwidgetlinecontrol_p.h.
References QGuiApplication::inputMethod(), QInputMethod::reset(), and txt.
Referenced by processKeyEvent(), and QLineEditPrivate::setText().
|
inline |
Definition at line 269 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 152 of file qwidgetlinecontrol_p.h.
Referenced by setSelection().
|
inline |
Definition at line 226 of file qwidgetlinecontrol_p.h.
References QString::fromLatin1(), and QString::isNull().
|
inline |
Definition at line 208 of file qwidgetlinecontrol_p.h.
References QString::fromLatin1().
Referenced by processKeyEvent(), QLineEditPrivate::shouldShowPlaceholderText(), QLineEditPrivate::textAfterCursor(), and QLineEditPrivate::textBeforeCursor().
|
inline |
Definition at line 130 of file qwidgetlinecontrol_p.h.
References QString::mid().
Referenced by processKeyEvent().
|
inline |
Definition at line 129 of file qwidgetlinecontrol_p.h.
References QString::left().
|
inline |
Definition at line 367 of file qwidgetlinecontrol_p.h.
Referenced by del(), draw(), rectForPos(), selectWordAtPos(), and xToPos().
|
overrideprotectedvirtual |
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 1531 of file qwidgetlinecontrol.cpp.
References clear(), cursorRect(), emit, inputMask(), QObject::killTimer(), and updateNeeded().
void QWidgetLineControl::undo | ( | ) |
Undoes the previous operation.
Definition at line 255 of file qwidgetlinecontrol.cpp.
References clear(), and QLineEdit::Normal.
Referenced by processKeyEvent().
void QWidgetLineControl::updateCursorBlinking | ( | ) |
Definition at line 1501 of file qwidgetlinecontrol.cpp.
References QStyleHints::cursorFlashTime, cursorRect(), emit, inputMask(), QObject::killTimer(), QObject::startTimer(), QGuiApplication::styleHints(), and updateNeeded().
Referenced by setBlinkingCursorEnabled(), and setReadOnly().
|
signal |
void QWidgetLineControl::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 352 of file qwidgetlinecontrol.cpp.
Referenced by processInputMethodEvent(), processKeyEvent(), and QLineEditPrivate::updatePasswordEchoEditing().
|
inline |
Definition at line 268 of file qwidgetlinecontrol_p.h.
|
inline |
Definition at line 121 of file qwidgetlinecontrol_p.h.
References qRound().
int QWidgetLineControl::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 366 of file qwidgetlinecontrol.cpp.
References QTextLayout::lineAt(), textLayout(), and QTextLine::xToCursor().
Referenced by QLineEditPrivate::xToPos().