8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qframe.h>
10#include <QtGui/qtextcursor.h>
11#include <QtCore/qstring.h>
12#include <QtCore/qmargins.h>
20class QLineEditPrivate;
22class QStyleOptionFrame;
23class QAbstractSpinBox;
28class Q_WIDGETS_EXPORT QLineEdit :
public QWidget
32 Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask)
33 Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER
true)
34 Q_PROPERTY(
int maxLength READ maxLength WRITE setMaxLength)
35 Q_PROPERTY(
bool frame READ hasFrame WRITE setFrame)
36 Q_PROPERTY(EchoMode echoMode READ echoMode WRITE setEchoMode)
37 Q_PROPERTY(QString displayText READ displayText)
38 Q_PROPERTY(
int cursorPosition READ cursorPosition WRITE setCursorPosition)
39 Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
40 Q_PROPERTY(
bool modified READ isModified WRITE setModified DESIGNABLE
false)
41 Q_PROPERTY(
bool hasSelectedText READ hasSelectedText)
42 Q_PROPERTY(QString selectedText READ selectedText)
43 Q_PROPERTY(
bool dragEnabled READ dragEnabled WRITE setDragEnabled)
44 Q_PROPERTY(
bool readOnly READ isReadOnly WRITE setReadOnly)
45 Q_PROPERTY(
bool undoAvailable READ isUndoAvailable)
46 Q_PROPERTY(
bool redoAvailable READ isRedoAvailable)
47 Q_PROPERTY(
bool acceptableInput READ hasAcceptableInput)
48 Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
49 Q_PROPERTY(Qt::CursorMoveStyle cursorMoveStyle READ cursorMoveStyle WRITE setCursorMoveStyle)
50 Q_PROPERTY(
bool clearButtonEnabled READ isClearButtonEnabled WRITE setClearButtonEnabled)
56 Q_ENUM(ActionPosition)
58 explicit QLineEdit(QWidget *parent =
nullptr);
59 explicit QLineEdit(
const QString &, QWidget *parent =
nullptr);
64 QString displayText()
const;
66 QString placeholderText()
const;
67 void setPlaceholderText(
const QString &);
69 int maxLength()
const;
70 void setMaxLength(
int);
73 bool hasFrame()
const;
75 void setClearButtonEnabled(
bool enable);
76 bool isClearButtonEnabled()
const;
78 enum EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit };
80 EchoMode echoMode()
const;
81 void setEchoMode(EchoMode);
83 bool isReadOnly()
const;
84 void setReadOnly(
bool);
86#ifndef QT_NO_VALIDATOR
87 void setValidator(
const QValidator *);
88 const QValidator * validator()
const;
91#if QT_CONFIG(completer)
92 void setCompleter(QCompleter *completer);
93 QCompleter *completer()
const;
96 QSize sizeHint()
const override;
97 QSize minimumSizeHint()
const override;
99 int cursorPosition()
const;
100 void setCursorPosition(
int);
101 int cursorPositionAt(
const QPoint &pos);
103 void setAlignment(Qt::Alignment flag);
104 Qt::Alignment alignment()
const;
106 void cursorForward(
bool mark,
int steps = 1);
107 void cursorBackward(
bool mark,
int steps = 1);
108 void cursorWordForward(
bool mark);
109 void cursorWordBackward(
bool mark);
112 void home(
bool mark);
115 bool isModified()
const;
116 void setModified(
bool);
118 void setSelection(
int,
int);
119 bool hasSelectedText()
const;
120 QString selectedText()
const;
121 int selectionStart()
const;
122 int selectionEnd()
const;
123 int selectionLength()
const;
125 bool isUndoAvailable()
const;
126 bool isRedoAvailable()
const;
128 void setDragEnabled(
bool b);
129 bool dragEnabled()
const;
131 void setCursorMoveStyle(Qt::CursorMoveStyle style);
132 Qt::CursorMoveStyle cursorMoveStyle()
const;
134 QString inputMask()
const;
135 void setInputMask(
const QString &inputMask);
136 bool hasAcceptableInput()
const;
138 void setTextMargins(
int left,
int top,
int right,
int bottom);
139 void setTextMargins(
const QMargins &margins);
140 QMargins textMargins()
const;
143 using QWidget::addAction;
144 void addAction(QAction *action, ActionPosition position);
145 QAction *addAction(
const QIcon &icon, ActionPosition position);
149 void setText(
const QString &);
154#ifndef QT_NO_CLIPBOARD
162 void insert(
const QString &);
163#ifndef QT_NO_CONTEXTMENU
164 QMenu *createStandardContextMenu();
168 void textChanged(
const QString &);
169 void textEdited(
const QString &);
170 void cursorPositionChanged(
int,
int);
171 void returnPressed();
172 void editingFinished();
173 void selectionChanged();
174 void inputRejected();
177 void mousePressEvent(QMouseEvent *) override;
178 void mouseMoveEvent(QMouseEvent *) override;
179 void mouseReleaseEvent(QMouseEvent *) override;
180 void mouseDoubleClickEvent(QMouseEvent *) override;
181 void keyPressEvent(QKeyEvent *) override;
182 void keyReleaseEvent(QKeyEvent *) override;
183 void focusInEvent(QFocusEvent *) override;
184 void focusOutEvent(QFocusEvent *) override;
185 void paintEvent(QPaintEvent *) override;
186#if QT_CONFIG(draganddrop)
187 void dragEnterEvent(QDragEnterEvent *) override;
188 void dragMoveEvent(QDragMoveEvent *e) override;
189 void dragLeaveEvent(QDragLeaveEvent *e) override;
190 void dropEvent(QDropEvent *) override;
192 void changeEvent(QEvent *) override;
193#ifndef QT_NO_CONTEXTMENU
194 void contextMenuEvent(QContextMenuEvent *) override;
197 void inputMethodEvent(QInputMethodEvent *) override;
198 virtual void initStyleOption(QStyleOptionFrame *option)
const;
200 QVariant inputMethodQuery(Qt::InputMethodQuery)
const override;
201 Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument)
const;
202 void timerEvent(QTimerEvent *) override;
203 bool event(QEvent *) override;
205 QRect cursorRect()
const;
210 friend class QAbstractSpinBox;
211 friend class QAccessibleLineEdit;
212 friend class QComboBox;
213#ifdef QT_KEYPAD_NAVIGATION
214 friend class QDateTimeEdit;
216 Q_DISABLE_COPY(QLineEdit)
217 Q_DECLARE_PRIVATE(QLineEdit)
void releaseColorPicking()
QColor grabScreenColor(const QPoint &p)
bool selectColor(const QColor &color)
void init(const QColor &initial)
void setCurrentAlpha(int a)
QColorPickingEventFilter * colorPickingEventFilter
bool handleColorPickingMouseButtonRelease(QMouseEvent *e)
QColor currentQColor() const
void updateColorPicking()
bool handleColorPickingMouseMove(QMouseEvent *e)
QLabel * lblScreenColorInfo
void _q_setCustom(int index, QRgb color)
QPushButton * eyeDropperButton
void updateColorLabelText(const QPoint &)
void setCurrentColor(const QColor &color, SetColorMode setColorMode=SetColorAll)
bool isAlphaVisible() const
void setCurrentQColor(const QColor &color)
bool canBeNativeDialog() const override
void setCurrentRgbColor(QRgb rgb)
void retranslateStrings()
QRgb currentColor() const
void newColorTypedIn(QRgb rgb)
bool handleColorPickingKeyPress(QKeyEvent *e)
void updateColorPicking(const QPoint &pos)
QSharedPointer< QColorDialogOptions > options
void newStandard(int, int)
void setVisible(bool visible) override
QDialogButtonBox * buttons
bool supportsColorPicking() const
QPointer< QObject > receiverToDisconnectOnClose
QRgb beforeScreenColorPicking
virtual void initHelper(QPlatformDialogHelper *h) override
QByteArray memberToDisconnectOnClose
void newHsv(int h, int s, int v)
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QColorLuminancePicker * lp
QPlatformColorDialogHelper * platformColorDialogHelper() const
void nextCustom(int, int)
The QColorDialog class provides a dialog widget for specifying colors.
\inmodule QtCore\reentrant
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
QColSpinBox(QWidget *parent)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void setCol(int h, int s)
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
QSize sizeHint() const override
void setCrossVisible(bool visible)
void resizeEvent(QResizeEvent *) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
bool eventFilter(QObject *, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void applicationStateChanged(Qt::ApplicationState state)
QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent)
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
QColor currentQColor() const
void setCurrentAlpha(int a)
bool isAlphaVisible() const
void setHsv(int h, int s, int v)
void retranslateStrings()
QRgb currentColor() const
void currentColorChanged(const QColor &color)
QColorWell(QWidget *parent, int r, int c, const QRgb *vals)
void paintCellContents(QPainter *, int row, int col, const QRect &) override
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
friend class QT_PREPEND_NAMESPACE(QUntypedBindable)
void mouseReleaseEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void focusOutEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
void currentChanged(int row, int col)
int columnAt(int x) const
void updateCell(int row, int column)
void colorChanged(int index, QRgb color)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void focusInEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
virtual void setCurrent(int row, int col)
virtual void setSelected(int row, int col)
QRect cellGeometry(int row, int column)
virtual void paintCell(QPainter *, int row, int col, const QRect &)
int columnX(int column) const
QSize sizeHint() const override
virtual void paintCellContents(QPainter *, int row, int col, const QRect &)
int selectedColumn() const
void keyPressEvent(QKeyEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
QString cellContent(int row, int col) const
QtPrivate::QColorShower QColorShower
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
QtPrivate::QColorWell QColorWell
QtPrivate::QWellArray QWellArray
QtPrivate::QColorPickingEventFilter QColorPickingEventFilter
QtPrivate::QColorLuminancePicker QColorLuminancePicker
QtPrivate::QColorPicker QColorPicker
static const Qt::WindowFlags qcd_DefaultWindowFlags
QT_REQUIRE_CONFIG(colordialog)
QT_REQUIRE_CONFIG(progressbar)