45 #ifndef QT_NO_LINEEDIT 67 #include <private/qtextedit_p.h> 68 #ifndef QT_NO_ACCESSIBILITY 76 #include "private/qstylesheetstyle_p.h" 78 #ifndef QT_NO_SHORTCUT 79 #include "private/qapplication_p.h" 80 #include "private/qshortcutmap_p.h" 82 #define ACCEL_KEY(k) (!qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? QLatin1Char('\t') + QString(QKeySequence(k)) : QString()) 84 #define ACCEL_KEY(k) QString() 116 if (
d->control->isReadOnly())
118 #ifdef QT_KEYPAD_NAVIGATION
120 option->
state |= QStyle::State_HasEditFocus;
363 d->control->setInputMask(inputMask);
364 d->control->moveCursor(
d->control->nextMaskBlank(contents.
length()));
398 return d->control->text();
404 d->control->setText(text);
427 return d->placeholderText;
433 if (
d->placeholderText != placeholderText) {
460 return d->control->displayText();
488 return d->control->maxLength();
494 d->control->setMaxLength(maxLength);
572 return (
EchoMode)
d->control->echoMode();
578 if (mode == (
EchoMode)
d->control->echoMode())
592 d->control->setEchoMode(mode);
601 #ifndef QT_NO_VALIDATOR 612 return d->control->validator();
630 d->control->setValidator(v);
632 #endif // QT_NO_VALIDATOR 634 #ifndef QT_NO_COMPLETER 657 if (c ==
d->control->completer())
659 if (
d->control->completer()) {
661 d->control->completer()->setWidget(0);
662 if (
d->control->completer()->parent() ==
this)
663 delete d->control->completer();
665 d->control->setCompleter(c);
689 return d->control->completer();
692 #endif // QT_NO_COMPLETER 706 int h =
qMax(fm.
height(), 14) + 2*
d->verticalMargin
707 +
d->topTextMargin +
d->bottomTextMargin
708 +
d->topmargin +
d->bottommargin;
710 +
d->leftTextMargin +
d->rightTextMargin
711 +
d->leftmargin +
d->rightmargin;
731 +
d->topmargin +
d->bottommargin;
732 int w = fm.
maxWidth() +
d->leftmargin +
d->rightmargin;
755 return d->control->cursorPosition();
761 d->control->setCursorPosition(pos);
771 return d->xToPos(pos.
x());
783 bool QLineEdit::validateAndSet(
const QString &newText,
int newPos,
784 int newMarkAnchor,
int newMarkDrag)
794 int selstart =
qMin(newMarkAnchor, newMarkDrag);
795 int sellength =
qAbs(newMarkAnchor - newMarkDrag);
796 if (selstart == newPos) {
797 selstart =
qMax(newMarkAnchor, newMarkDrag);
798 sellength = -sellength;
824 return QFlag(
d->alignment);
846 d->control->cursorForward(mark, steps);
871 d->control->cursorWordForward(mark);
884 d->control->cursorWordBackward(mark);
899 d->control->backspace();
928 d->control->home(mark);
943 d->control->end(mark);
971 return d->control->isModified();
977 d->control->setModified(modified);
1008 return d->control->hasSelectedText();
1029 return d->control->selectedText();
1042 return d->control->selectionStart();
1063 bool QLineEdit::edited()
const {
return isModified(); }
1067 void QLineEdit::setEdited(
bool on) {
setModified(on); }
1072 int QLineEdit::characterAt(
int xpos,
QChar *chr)
const 1077 if (chr && pos < (
int) txt.
length())
1086 bool QLineEdit::getSelection(
int *start,
int *
end)
1089 if (
d->control->hasSelectedText() && start &&
end) {
1109 if (start < 0 || start > (
int)
d->control->text().length()) {
1110 qWarning(
"QLineEdit::setSelection: Invalid start position (%d)", start);
1114 d->control->setSelection(start, length);
1116 if (
d->control->hasSelectedText()){
1120 d->setCursorVisible(
false);
1140 return d->control->isUndoAvailable();
1159 return d->control->isRedoAvailable();
1176 return d->dragEnabled;
1216 return d->control->cursorMoveStyle();
1231 d->control->setCursorMoveStyle(style);
1249 return d->control->hasAcceptableInput();
1262 d->leftTextMargin =
left;
1263 d->topTextMargin = top;
1264 d->rightTextMargin =
right;
1265 d->bottomTextMargin = bottom;
1294 *left =
d->leftTextMargin;
1296 *top =
d->topTextMargin;
1298 *right =
d->rightTextMargin;
1300 *bottom =
d->bottomTextMargin;
1315 return QMargins(
d->leftTextMargin,
d->topTextMargin,
d->rightTextMargin,
d->bottomTextMargin);
1387 return d->control->inputMask();
1393 d->control->setInputMask(inputMask);
1408 d->control->selectAll();
1420 d->control->deselect();
1435 d->control->insert(newText);
1447 d->control->clear();
1496 return d->control->isReadOnly();
1502 if (
d->control->isReadOnly() != enable) {
1503 d->control->setReadOnly(enable);
1506 #ifndef QT_NO_CURSOR 1514 #ifndef QT_NO_CLIPBOARD 1561 d->control->paste();
1564 #endif // !QT_NO_CLIPBOARD 1575 #ifndef QT_NO_DRAGANDDROP 1576 }
else if (timerId ==
d->dndTimer.timerId()) {
1580 else if (timerId ==
d->tripleClickTimer.timerId())
1581 d->tripleClickTimer.stop();
1584 if (
d->control->composeMode())
1591 d->control->processEvent(e);
1602 d->setCursorVisible(
true);
1606 #ifdef QT_KEYPAD_NAVIGATION 1607 if (QApplication::keypadNavigationEnabled()) {
1608 if (e->
type() == QEvent::EnterEditFocus) {
1610 d->setCursorVisible(
true);
1612 }
else if (e->
type() == QEvent::LeaveEditFocus) {
1613 d->setCursorVisible(
false);
1614 d->control->setCursorBlinkPeriod(0);
1615 if (
d->control->hasAcceptableInput() ||
d->control->fixup())
1628 if (
d->sendMouseEventToInputContext(e))
1632 #ifdef QT_KEYPAD_NAVIGATION 1633 if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
1636 if (
d->control->completer())
1637 d->control->completer()->complete();
1640 if (
d->tripleClickTimer.isActive() && (e->
pos() -
d->tripleClick).manhattanLength() <
1647 #ifndef QT_NO_DRAGANDDROP 1648 if (!mark &&
d->dragEnabled &&
d->control->echoMode() ==
Normal &&
1650 d->dndPos = e->
pos();
1651 if (!
d->dndTimer.isActive())
1656 d->control->moveCursor(cursor, mark);
1665 if (
d->sendMouseEventToInputContext(e))
1669 #ifndef QT_NO_DRAGANDDROP 1670 if (
d->dndTimer.isActive()) {
1676 d->control->moveCursor(
d->xToPos(e->
pos().
x()),
true);
1686 if (
d->sendMouseEventToInputContext(e))
1688 #ifndef QT_NO_DRAGANDDROP 1690 if (
d->dndTimer.isActive()) {
1697 #ifndef QT_NO_CLIPBOARD 1709 d->handleSoftwareInputPanel(e->
button(),
d->clickCausedFocus);
1710 d->clickCausedFocus = 0;
1718 if (
d->sendMouseEventToInputContext(e))
1721 d->control->selectWordAtPos(
d->xToPos(e->
pos().
x()));
1723 d->tripleClick = e->
pos();
1767 #ifdef QT_KEYPAD_NAVIGATION 1769 switch (event->
key()) {
1771 if (QApplication::keypadNavigationEnabled()) {
1772 if (hasEditFocus()) {
1773 setEditFocus(
false);
1774 if (
d->control->completer() &&
d->control->completer()->popup()->isVisible())
1775 d->control->completer()->popup()->hide();
1782 if (!QApplication::keypadNavigationEnabled() || !hasEditFocus()) {
1788 if (QApplication::keypadNavigationEnabled()) {
1790 if (!event->
text().
isEmpty() &&
event->text().at(0).isPrint()
1803 if (QApplication::keypadNavigationEnabled() && !select && !hasEditFocus()) {
1809 d->control->processKeyEvent(event);
1813 d->control->setCursorBlinkPeriod(0);
1828 return d->cursorRect();
1836 if (
d->control->isReadOnly()) {
1845 d->updatePasswordEchoEditing(
true);
1849 #ifdef QT_KEYPAD_NAVIGATION 1853 if (QApplication::keypadNavigationEnabled()
1859 d->control->processInputMethodEvent(e);
1861 #ifndef QT_NO_COMPLETER 1874 return d->cursorRect();
1886 if (
d->control->selectionStart() ==
d->control->selectionEnd())
1888 else if (
d->control->selectionStart() ==
d->control->cursor())
1889 return QVariant(
d->control->selectionEnd());
1891 return QVariant(
d->control->selectionStart());
1906 if (!
d->control->inputMask().isEmpty())
1907 d->control->moveCursor(
d->control->nextMaskBlank(0));
1908 else if (!
d->control->hasSelectedText())
1911 d->clickCausedFocus = 1;
1913 #ifdef QT_KEYPAD_NAVIGATION 1925 d->setCursorVisible(
true);
1927 if (
d->control->echoMode() ==
Password ||
d->control->echoMode() ==
NoEcho)
1930 #ifdef QT_KEYPAD_NAVIGATION 1931 d->control->setCancelText(
d->control->text());
1934 #ifndef QT_NO_COMPLETER 1935 if (
d->control->completer()) {
1936 d->control->completer()->setWidget(
this);
1952 if (
d->control->passwordEchoEditing()) {
1955 d->updatePasswordEchoEditing(
false);
1963 d->setCursorVisible(
false);
1964 d->control->setCursorBlinkPeriod(0);
1965 #ifdef QT_KEYPAD_NAVIGATION 1967 if (!QApplication::keypadNavigationEnabled())
1978 if (
d->control->echoMode() ==
Password ||
d->control->echoMode() ==
NoEcho)
1981 #ifdef QT_KEYPAD_NAVIGATION 1982 d->control->setCancelText(
QString());
1984 #ifndef QT_NO_COMPLETER 1985 if (
d->control->completer()) {
2006 r.
setX(r.
x() +
d->leftTextMargin);
2007 r.
setY(r.
y() +
d->topTextMargin);
2019 d->vscroll = r.
y() +
d->verticalMargin;
2026 QRect lineRect(r.
x() +
d->horizontalMargin,
d->vscroll, r.
width() - 2*
d->horizontalMargin, fm.
height());
2031 if (
d->control->text().isEmpty()) {
2032 if (!
hasFocus() && !
d->placeholderText.isEmpty()) {
2037 lineRect.adjust(minLB, 0, 0, 0);
2039 p.
drawText(lineRect, va, elidedText);
2045 int cix =
qRound(
d->control->cursorToX());
2053 int widthUsed =
qRound(
d->control->naturalTextWidth()) + 1 + minRB;
2054 if ((minLB + widthUsed) <= lineRect.width()) {
2058 d->hscroll = widthUsed - lineRect.width() + 1;
2061 d->hscroll = (widthUsed - lineRect.width()) / 2;
2068 d->hscroll -= minLB;
2069 }
else if (cix -
d->hscroll >= lineRect.width()) {
2071 d->hscroll = cix - lineRect.width() + 1;
2072 }
else if (cix -
d->hscroll < 0 &&
d->hscroll < widthUsed) {
2075 }
else if (widthUsed -
d->hscroll < lineRect.width()) {
2078 d->hscroll = widthUsed - lineRect.width() + 1;
2081 d->hscroll =
qMax(0,
d->hscroll);
2088 #ifndef QT_NO_STYLE_STYLESHEET 2090 cssStyle->styleSheetPalette(
this, &panel, &pal);
2097 #ifdef QT_KEYPAD_NAVIGATION 2098 if (!QApplication::keypadNavigationEnabled() || hasEditFocus())
2100 if (
d->control->hasSelectedText() || (
d->cursorVisible && !
d->control->inputMask().isEmpty() && !
d->control->isReadOnly())){
2103 if (
d->control->palette() != pal
2105 d->control->setPalette(pal);
2111 if (
d->cursorVisible && !
d->control->isReadOnly())
2115 d->control->draw(&p, topLeft, r, flags);
2120 #ifndef QT_NO_DRAGANDDROP 2128 d->control->moveCursor(
d->xToPos(e->
pos().
x()),
false);
2129 d->cursorVisible =
true;
2144 if (
d->cursorVisible) {
2145 d->cursorVisible =
false;
2156 if (!str.
isNull() && !
d->control->isReadOnly()) {
2159 int cursorPos =
d->xToPos(e->
pos().
x());
2160 int selStart = cursorPos;
2161 int oldSelStart =
d->control->selectionStart();
2162 int oldSelEnd =
d->control->selectionEnd();
2163 d->control->moveCursor(cursorPos,
false);
2164 d->cursorVisible =
false;
2167 if (e->
source() ==
this) {
2169 if (selStart > oldSelStart && selStart <= oldSelEnd)
2171 else if (selStart > oldSelEnd)
2185 #endif // QT_NO_DRAGANDDROP 2187 #ifndef QT_NO_CONTEXTMENU 2213 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 2232 action->
setEnabled(
d->control->isUndoAvailable());
2236 action->
setEnabled(
d->control->isRedoAvailable());
2242 #ifndef QT_NO_CLIPBOARD 2245 action->
setEnabled(!
d->control->isReadOnly() &&
d->control->hasSelectedText()
2264 action->
setEnabled(!
d->control->isReadOnly() && !
d->control->text().isEmpty() &&
d->control->hasSelectedText());
2272 action->
setEnabled(!
d->control->text().isEmpty() && !
d->control->allSelected());
2273 d->selectAllAction = action;
2276 #if !defined(QT_NO_IM) 2280 for (
int i = 0; i < imActions.
size(); ++i)
2285 #if defined(Q_WS_WIN) || defined(Q_WS_X11) 2288 if (!
d->control->isReadOnly()) {
2292 popup->
addMenu(ctrlCharacterMenu);
2296 #endif // QT_NO_CONTEXTMENU 2309 d->control->setFont(
font());
2501 #include "moc_qlineedit.cpp" 2503 #endif // QT_NO_LINEEDIT The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
void acceptProposedAction()
Sets the drop action to be the proposed action.
bool hasSelectedText() const
void undo()
Undoes the last operation if undo is available.
void keyPressEvent(QKeyEvent *)
Converts the given key press event into a line edit action.
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
int selectionStart() const
selectionStart() returns the index of the first selected character in the line edit or -1 if no text ...
bool isRedoAvailable() const
The QKeyEvent class describes a key event.
void changeEvent(QEvent *)
Reimplemented Function
void setTextMargins(int left, int top, int right, int bottom)
Sets the margins around the text inside the frame to have the sizes left, top, right, and bottom.
void setAlignment(Qt::Alignment flag)
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
int cursorPositionAt(const QPoint &pos)
Returns the cursor position under the point pos.
void copy() const
Copies the selected text to the clipboard, if there is any, and if echoMode() is Normal ...
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
int leading() const
Returns the leading of the font.
const QChar at(int i) const
Returns the character at the given index position in the string.
void cut()
Copies the selected text to the clipboard and deletes it, if there is any, and if echoMode() is Norma...
void focusInEvent(QFocusEvent *)
em>Reimplemented Function
int maxWidth() const
Returns the width of the widest character in the font.
QStyle::State state
the style flags that are used when drawing the control
The QFlag class is a helper data type for QFlags.
static QSize globalStrut()
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
int length() const
Returns the number of characters in this string.
void setCompleter(QCompleter *completer)
Sets this line edit to provide auto completions from the completer, c.
void qt_mac_secure_keyboard(bool)
void cursorWordBackward(bool mark)
Moves the cursor one word backward.
void end(bool mark)
Moves the text cursor to the end of the line unless it is already there.
Qt::DropAction dropAction() const
Returns the action to be performed on the data by the target.
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QMenu * createStandardContextMenu()
This function creates the standard context menu which is shown when the user clicks on the line edit ...
void deselect()
Deselects any selected text.
int width() const
Returns the width of the rectangle.
The QCompleter class provides completions based on an item model.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QSize minimumSizeHint() const
Returns a minimum size for the line edit.
static int cursorFlashTime()
void setPlaceholderText(const QString &)
int height() const
Returns the height of the rectangle.
void setY(int y)
Sets the top edge of the rectangle to the given y coordinate.
void paintEvent(QPaintEvent *)
em>Reimplemented Function
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
Q_DECL_CONSTEXPR T qAbs(const T &t)
int minLeftBearing() const
Returns the minimum left bearing of the font.
void del()
If no text is selected, deletes the character to the right of the text cursor.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
void mouseMoveEvent(QMouseEvent *)
Reimplemented Function
void dropEvent(QDropEvent *)
This event handler is called when the drag is dropped on this widget.
The QChar class provides a 16-bit Unicode character.
virtual QList< QAction * > actions()
This is a preliminary interface for Qt 4.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QCompleter * completer() const
Returns the current QCompleter that provides completions.
void cursorWordForward(bool mark)
Moves the cursor one word forward.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
If the string text is wider than width, returns an elided version of the string (i.
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
int minRightBearing() const
Returns the minimum right bearing of the font.
void setObjectName(const QString &name)
ColorGroup currentColorGroup() const
Returns the palette's current color group.
void mousePressEvent(QMouseEvent *)
Reimplemented Function
int top() const
Returns the top margin.
void cursorBackward(bool mark, int steps=1)
Moves the cursor back steps characters.
int ascent() const
Returns the ascent of the font.
void cursorForward(bool mark, int steps=1)
Moves the cursor forward steps characters.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
int lineWidth
the line width for drawing the frame
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
QString displayText() const
void inputMethodEvent(QInputMethodEvent *)
Reimplemented Function
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QValidator class provides validation of input text.
EchoMode
This enum type describes how a line edit should display its contents.
void setDragEnabled(bool b)
QString selectedText() const
QString text() const
Returns a plain text (MIME type text/plain) representation of the data.
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
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 rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void insert(const QString &)
Deletes any selected text, inserts newText, and validates the result.
void initFrom(const QWidget *w)
void backspace()
If no text is selected, deletes the character to the left of the text cursor and moves the cursor one...
const T & at(int i) const
Returns the item at index position i in the list.
void mouseDoubleClickEvent(QMouseEvent *)
Reimplemented Function
void setSelection(int, int)
Selects text from position start and for length characters.
void setRight(int pos)
Sets the right edge of the rectangle to the given x coordinate.
static int startDragTime()
void setValidator(const QValidator *)
Sets this line edit to only accept input that the validator, v, will accept.
bool modified
whether the line edit's contents has been modified by the user
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
const char * styleHint(const QFontDef &request)
Q_CORE_EXPORT void qWarning(const char *,...)
void editingFinished()
This signal is emitted when the Return or Enter key is pressed or the line edit loses focus...
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
void dragMoveEvent(QDragMoveEvent *e)
em>Reimplemented Function
void paste()
Inserts the clipboard's text at the cursor position, deleting any selected text, providing the line e...
const QValidator * validator() const
Returns a pointer to the current input validator, or 0 if no validator has been set.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
static int startDragDistance()
void mouseReleaseEvent(QMouseEvent *)
Reimplemented Function
QSize sizeHint() const
Returns a recommended size for the widget.
Qt::MouseButton button() const
Returns the button that caused the event.
void setX(int x)
Sets the left edge of the rectangle to the given x coordinate.
bool isEqual(ColorGroup cr1, ColorGroup cr2) const
Returns true (usually quickly) if color group cg1 is equal to cg2; otherwise returns false...
void contextMenuEvent(QContextMenuEvent *)
Shows the standard context menu created with createStandardContextMenu().
The QMouseEvent class contains parameters that describe a mouse event.
void setText(const QString &)
bool isNull() const
Returns true if this string is null; otherwise returns false.
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.
virtual bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
void home(bool mark)
Moves the text cursor to the beginning of the line unless it is already there.
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=0) const =0
Returns the sub-area for the given element as described in the provided style option.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
static QWidget * activePopupWidget()
Returns the active popup widget.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
int right() const
Returns the x-coordinate of the rectangle's right edge.
The QTimerEvent class contains parameters that describe a timer event.
void clear()
Clears the contents of the line edit.
bool qt_use_rtl_extensions
void setInputMask(const QString &inputMask)
CursorMoveStyle
This enum describes the movement style available to text cursors.
int y() const
Returns the y-coordinate of the rectangle's top edge.
QString text() const
Returns the Unicode text that this key generated.
int midLineWidth
the mid-line width for drawing the frame
void setWidget(QWidget *widget)
Sets the widget for which completion are provided for to widget.
void focusOutEvent(QFocusEvent *)
em>Reimplemented Function
QWidget * source() const
If the source of the drag operation is a widget in this application, this function returns that sourc...
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
bool singleShot
This static function calls a slot after a given time interval.
int size() const
Returns the number of items in the list.
void setAlpha(int alpha)
Sets the alpha of this color to alpha.
QString inputMask() const
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
void initStyleOption(QStyleOptionFrame *option) const
Initialize option with the values from this QLineEdit.
The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt ...
QLineEdit(QWidget *parent=0)
Constructs a line edit with no text.
The QLineEdit widget is a one-line text editor.
QVariant property(const char *name) const
Returns the value of the object's name property.
~QLineEdit()
Destroys the line edit.
int left() const
Returns the left margin.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void setEchoMode(EchoMode)
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
The QSize class defines the size of a two-dimensional object using integer point precision.
void redo()
Redoes the last operation if redo is available.
int x() const
Returns the x coordinate of this point.
void setCursorPosition(int)
void selectAll()
Selects all the text (i.e.
The QInputContext class abstracts the input method dependent data and composing state.
The QMargins class defines the four margins of a rectangle.
int height() const
Returns the height of the font.
QRect cursorRect() const
Returns a rectangle that includes the lineedit cursor.
QString placeholderText() const
The QPaintEvent class contains event parameters for paint events.
QVariant inputMethodQuery(Qt::InputMethodQuery) const
em>Reimplemented Function
int cursorPosition() const
bool event(QEvent *)
Reimplemented Function
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
Qt::Alignment alignment() const
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
static int doubleClickInterval()
int bottom() const
Returns the bottom margin.
void dragLeaveEvent(QDragLeaveEvent *e)
em>Reimplemented Function
bool hasAcceptableInput() const
EchoMode echoMode() const
bool isUndoAvailable() const
void setCursorMoveStyle(Qt::CursorMoveStyle style)
Sets the movement style for the cursor in the line edit to the given style.
QString text(Mode mode=Clipboard) const
Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any te...
int right() const
Returns the right margin.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QMargins textMargins() const
Returns the widget's text margins.
QWidget * widget() const
Returns the widget for which the completer object is providing completions.
QRect rect
the area that should be used for various calculations and painting
The QFocusEvent class contains event parameters for widget focus events.
Q_DECL_CONSTEXPR int qRound(qreal d)
The QAction class provides an abstract user interface action that can be inserted into widgets...
void getTextMargins(int *left, int *top, int *right, int *bottom) const
Returns the widget's text margins for left, top, right, and bottom.
void dragEnterEvent(QDragEnterEvent *)
em>Reimplemented Function
const QPoint & pos() const
Returns the position where the drop was made.
const QBrush & text() const
Returns the text foreground brush of the current color group.
The QList class is a template class that provides lists.
Qt::CursorMoveStyle cursorMoveStyle() const
The QPalette class contains color groups for each widget state.