18#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include "private/qwidget_p.h"
21#include "QtWidgets/qlineedit.h"
22#if QT_CONFIG(toolbutton)
23#include "QtWidgets/qtoolbutton.h"
25#include "QtGui/qtextlayout.h"
26#include "QtGui/qicon.h"
27#include "QtWidgets/qstyleoption.h"
28#include "QtCore/qbasictimer.h"
29#if QT_CONFIG(completer)
30#include "QtWidgets/qcompleter.h"
32#include "QtCore/qpointer.h"
33#include "QtCore/qmimedata.h"
34#include <QtCore/qmargins.h>
36#include "private/qwidgetlinecontrol_p.h"
47#if QT_CONFIG(toolbutton)
55 qreal opacity()
const {
return m_opacity; }
57#if QT_CONFIG(animation)
58 void animateShow(
bool visible);
60 bool shouldHideWithText()
const;
61 void setHideWithText(
bool hide);
62 bool needsSpace()
const {
76#if QT_CONFIG(animation)
77 void onAnimationFinished();
81#if QT_CONFIG(animation)
82 void startOpacityAnimation(
qreal endValue);
88#if QT_CONFIG(animation)
89 bool m_hideWithText =
false;
90 bool m_fadingOut =
false;
101 SideWidgetFadeInWithText = 0x1,
102 SideWidgetCreatedByWidgetAction = 0x2,
103 SideWidgetClearButton = 0x4
123 : control(
nullptr),
frame(1), contextMenuEnabled(1), cursorVisible(0),
124 dragEnabled(0), clickCausedFocus(0), edited(0), hscroll(0), vscroll(0),
126 textMargins{0, 0, 0, 0},
127 lastTextSize(0), mouseYThreshold(0)
137#ifndef QT_NO_CONTEXTMENU
141 void initMouseYThreshold();
143 QRect adjustedControlRect(
const QRect &)
const;
146 bool inSelection(
int x)
const;
147 QRect cursorRect()
const;
148 void setCursorVisible(
bool visible);
151 QString textBeforeCursor(
int curPos)
const;
152 QString textAfterCursor(
int curPos)
const;
153 void updatePasswordEchoEditing(
bool);
155 void resetInputMethod();
159#if defined (Q_OS_ANDROID)
160 return !control->
isReadOnly() || control->isSelectableByMouse();
191 QRect adjustedContentsRect()
const;
193 void _q_handleWindowActivate();
194 void _q_textEdited(
const QString &);
195 void _q_cursorPositionChanged(
int,
int);
196#ifdef QT_KEYPAD_NAVIGATION
197 void _q_editFocusChange(
bool);
199 void _q_selectionChanged();
200 void _q_updateNeeded(
const QRect &);
201#if QT_CONFIG(completer)
202 void _q_completionHighlighted(
const QString &);
205#if QT_CONFIG(draganddrop)
209 void _q_textChanged(
const QString &);
210 void _q_clearButtonClicked();
211 void _q_controlEditingFinished();
222 QIcon clearButtonIcon()
const;
223 void setClearButtonEnabled(
bool enabled);
224 void positionSideWidgets();
225 inline bool hasSideWidgets()
const {
return !leadingSideWidgets.empty() || !trailingSideWidgets.empty(); }
227 {
return q_func()->layoutDirection() ==
Qt::LeftToRight ? leadingSideWidgets : trailingSideWidgets; }
229 {
return q_func()->layoutDirection() ==
Qt::LeftToRight ? trailingSideWidgets : leadingSideWidgets; }
234 struct SideWidgetLocation {
238 bool isValid()
const {
return index >= 0; }
240 friend class QTypeInfo<SideWidgetLocation>;
243 SideWidgetLocation findSideWidget(
const QAction *
a)
const;
246 SideWidgetEntryList leadingSideWidgets;
247 SideWidgetEntryList trailingSideWidgets;
The QActionEvent class provides an event that is generated when a QAction is added,...
The QAction class provides an abstraction for user commands that can be added to different user inter...
The QIcon class provides scalable icons in different modes and states.
QBasicTimer tripleClickTimer
static const int horizontalMargin
static const int verticalMargin
QWidgetLineControl * control
bool shouldEnableInputMethod() const
QPointer< QAction > selectAllAction
static QLineEditPrivate * get(QLineEdit *lineEdit)
const SideWidgetEntryList & leftSideWidgetList() const
const SideWidgetEntryList & rightSideWidgetList() const
bool shouldShowPlaceholderText() const
bool hasSideWidgets() const
std::vector< SideWidgetEntry > SideWidgetEntryList
The QLineEdit widget is a one-line text editor.
ActionPosition
This enum type describes how a line edit should display the action widgets to be added.
The QPaintEvent class contains event parameters for paint events.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
CursorPosition
\value CursorBetweenCharacters \value CursorOnCharacter
@ CursorBetweenCharacters
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei const GLuint GLboolean enabled
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_AUTOTEST_EXPORT
#define QT_REQUIRE_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
SideWidgetEntry(QWidget *w=nullptr, QAction *a=nullptr, int _flags=0)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent