Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3921

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qlineedit.cpp -->
  <title>QLineEdit Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QLineEdit</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QLineEdit Class</h1>
<!-- $$$QLineEdit-brief -->
<p>The <a href="qlineedit.html">QLineEdit</a> widget is a one-line text editor. <a href="#details">More...</a></p>
<!-- @@@QLineEdit -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QLineEdit&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qwidget.html">QWidget</a></td></tr></table></div><ul>
<li><a href="qlineedit-members.html">List of all members, including inherited members</a></li>
<li><a href="qlineedit-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#ActionPosition-enum">ActionPosition</a></b> { LeadingPosition, TrailingPosition }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#EchoMode-enum">EchoMode</a></b> { Normal, NoEcho, Password, PasswordEchoOnEdit }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qlineedit.html#acceptableInput-prop">acceptableInput</a></b> : const bool</li>
<li class="fn"><b><a href="qlineedit.html#alignment-prop">alignment</a></b> : Qt::Alignment</li>
<li class="fn"><b><a href="qlineedit.html#clearButtonEnabled-prop">clearButtonEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qlineedit.html#cursorMoveStyle-prop">cursorMoveStyle</a></b> : Qt::CursorMoveStyle</li>
<li class="fn"><b><a href="qlineedit.html#cursorPosition-prop">cursorPosition</a></b> : int</li>
<li class="fn"><b><a href="qlineedit.html#displayText-prop">displayText</a></b> : const QString</li>
<li class="fn"><b><a href="qlineedit.html#dragEnabled-prop">dragEnabled</a></b> : bool</li>
<li class="fn"><b><a href="qlineedit.html#echoMode-prop">echoMode</a></b> : EchoMode</li>
<li class="fn"><b><a href="qlineedit.html#frame-prop">frame</a></b> : bool</li>
<li class="fn"><b><a href="qlineedit.html#hasSelectedText-prop">hasSelectedText</a></b> : const bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qlineedit.html#inputMask-prop">inputMask</a></b> : QString</li>
<li class="fn"><b><a href="qlineedit.html#maxLength-prop">maxLength</a></b> : int</li>
<li class="fn"><b><a href="qlineedit.html#modified-prop">modified</a></b> : bool</li>
<li class="fn"><b><a href="qlineedit.html#placeholderText-prop">placeholderText</a></b> : QString</li>
<li class="fn"><b><a href="qlineedit.html#readOnly-prop">readOnly</a></b> : bool</li>
<li class="fn"><b><a href="qlineedit.html#redoAvailable-prop">redoAvailable</a></b> : const bool</li>
<li class="fn"><b><a href="qlineedit.html#selectedText-prop">selectedText</a></b> : const QString</li>
<li class="fn"><b><a href="qlineedit.html#text-prop">text</a></b> : QString</li>
<li class="fn"><b><a href="qlineedit.html#undoAvailable-prop">undoAvailable</a></b> : const bool</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#QLineEdit">QLineEdit</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#QLineEdit-1">QLineEdit</a></b>(const QString &amp;<i>contents</i>, QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dtor.QLineEdit">~QLineEdit</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#addAction">addAction</a></b>(QAction *<i>action</i>, QLineEdit::ActionPosition <i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction *</td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#addAction-1">addAction</a></b>(const QIcon &amp;<i>icon</i>, QLineEdit::ActionPosition <i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#alignment-prop">alignment</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#backspace">backspace</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCompleter *</td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#completer">completer</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu *</td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#createStandardContextMenu">createStandardContextMenu</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorBackward">cursorBackward</a></b>(bool <i>mark</i>, int <i>steps</i> = 1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorForward">cursorForward</a></b>(bool <i>mark</i>, int <i>steps</i> = 1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::CursorMoveStyle </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorMoveStyle-prop">cursorMoveStyle</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorPosition-prop">cursorPosition</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorPositionAt">cursorPositionAt</a></b>(const QPoint &amp;<i>pos</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorWordBackward">cursorWordBackward</a></b>(bool <i>mark</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorWordForward">cursorWordForward</a></b>(bool <i>mark</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#del">del</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#deselect">deselect</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#displayText-prop">displayText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dragEnabled-prop">dragEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QLineEdit::EchoMode </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#echoMode-prop">echoMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#end">end</a></b>(bool <i>mark</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#getTextMargins">getTextMargins</a></b>(int *<i>left</i>, int *<i>top</i>, int *<i>right</i>, int *<i>bottom</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#acceptableInput-prop">hasAcceptableInput</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#frame-prop">hasFrame</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#hasSelectedText-prop">hasSelectedText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#home">home</a></b>(bool <i>mark</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#inputMask-prop">inputMask</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#insert">insert</a></b>(const QString &amp;<i>newText</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#clearButtonEnabled-prop">isClearButtonEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#modified-prop">isModified</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#readOnly-prop">isReadOnly</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#redoAvailable-prop">isRedoAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#undoAvailable-prop">isUndoAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#maxLength-prop">maxLength</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#placeholderText-prop">placeholderText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectedText-prop">selectedText</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectionEnd">selectionEnd</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectionLength">selectionLength</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectionStart">selectionStart</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#alignment-prop">setAlignment</a></b>(Qt::Alignment <i>flag</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#clearButtonEnabled-prop">setClearButtonEnabled</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#setCompleter">setCompleter</a></b>(QCompleter *<i>c</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorMoveStyle-prop">setCursorMoveStyle</a></b>(Qt::CursorMoveStyle <i>style</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorPosition-prop">setCursorPosition</a></b>(<i>int</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dragEnabled-prop">setDragEnabled</a></b>(bool <i>b</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#echoMode-prop">setEchoMode</a></b>(<i>QLineEdit::EchoMode</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#frame-prop">setFrame</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#inputMask-prop">setInputMask</a></b>(const QString &amp;<i>inputMask</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#maxLength-prop">setMaxLength</a></b>(<i>int</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#modified-prop">setModified</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#placeholderText-prop">setPlaceholderText</a></b>(<i>const QString &amp;</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#readOnly-prop">setReadOnly</a></b>(<i>bool</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#setSelection">setSelection</a></b>(int <i>start</i>, int <i>length</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#setTextMargins">setTextMargins</a></b>(int <i>left</i>, int <i>top</i>, int <i>right</i>, int <i>bottom</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#setTextMargins-1">setTextMargins</a></b>(const QMargins &amp;<i>margins</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#setValidator">setValidator</a></b>(const QValidator *<i>v</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#text-prop">text</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMargins </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#textMargins">textMargins</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QValidator *</td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#validator">validator</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#event">event</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#inputMethodQuery">inputMethodQuery</a></b>(Qt::InputMethodQuery <i>property</i>) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#minimumSizeHint">minimumSizeHint</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#sizeHint">sizeHint</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#copy">copy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cut">cut</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#paste">paste</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#redo">redo</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectAll">selectAll</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#text-prop">setText</a></b>(<i>const QString &amp;</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#undo">undo</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorPositionChanged">cursorPositionChanged</a></b>(int <i>oldPos</i>, int <i>newPos</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#editingFinished">editingFinished</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#inputRejected">inputRejected</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#returnPressed">returnPressed</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#selectionChanged">selectionChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#textChanged">textChanged</a></b>(const QString &amp;<i>text</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#textEdited">textEdited</a></b>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<ul>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#cursorRect">cursorRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#initStyleOption">initStyleOption</a></b>(QStyleOptionFrame *<i>option</i>) const</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#changeEvent">changeEvent</a></b>(QEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#contextMenuEvent">contextMenuEvent</a></b>(QContextMenuEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dragEnterEvent">dragEnterEvent</a></b>(QDragEnterEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dragLeaveEvent">dragLeaveEvent</a></b>(QDragLeaveEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dragMoveEvent">dragMoveEvent</a></b>(QDragMoveEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#dropEvent">dropEvent</a></b>(QDropEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#inputMethodEvent">inputMethodEvent</a></b>(QInputMethodEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#mouseMoveEvent">mouseMoveEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#mousePressEvent">mousePressEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qlineedit.html#paintEvent">paintEvent</a></b>(<i>QPaintEvent *</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QLineEdit-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qlineedit.html">QLineEdit</a> widget is a one-line text editor.</p>
<p class="centerAlign"><img src="images/windows-lineedit.png" alt="" /></p><p>A line edit allows the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop (see <a href="qlineedit.html#dragEnabled-prop">setDragEnabled</a>()).</p>
<p>By changing the <a href="qlineedit.html#echoMode-prop">echoMode</a>() of a line edit, it can also be used as a &quot;write-only&quot; field, for inputs such as passwords.</p>
<p>The length of the text can be constrained to <a href="qlineedit.html#maxLength-prop">maxLength</a>(). The text can be arbitrarily constrained using a <a href="qlineedit.html#validator">validator</a>() or an <a href="qlineedit.html#inputMask-prop">inputMask</a>(), or both. When switching between a validator and an input mask on the same line edit, it is best to clear the validator or input mask to prevent undefined behavior.</p>
<p>A related class is <a href="qtextedit.html">QTextEdit</a> which allows multi-line, rich text editing.</p>
<p>You can change the text with <a href="qlineedit.html#text-prop">setText</a>() or <a href="qlineedit.html#insert">insert</a>(). The text is retrieved with <a href="qlineedit.html#text-prop">text</a>(); the displayed text (which may be different, see <a href="qlineedit.html#EchoMode-enum">EchoMode</a>) is retrieved with <a href="qlineedit.html#displayText-prop">displayText</a>(). Text can be selected with <a href="qlineedit.html#setSelection">setSelection</a>() or <a href="qlineedit.html#selectAll">selectAll</a>(), and the selection can be <a href="qlineedit.html#cut">cut</a>(), <a href="qlineedit.html#copy">copy</a>()ied and <a href="qlineedit.html#paste">paste</a>()d. The text can be aligned with <a href="qlineedit.html#alignment-prop">setAlignment</a>().</p>
<p>When the text changes the <a href="qlineedit.html#textChanged">textChanged</a>() signal is emitted; when the text changes other than by calling <a href="qlineedit.html#text-prop">setText</a>() the <a href="qlineedit.html#textEdited">textEdited</a>() signal is emitted; when the cursor is moved the <a href="qlineedit.html#cursorPositionChanged">cursorPositionChanged</a>() signal is emitted; and when the Return or Enter key is pressed the <a href="qlineedit.html#returnPressed">returnPressed</a>() signal is emitted.</p>
<p>When editing is finished, either because the line edit lost focus or Return/Enter is pressed the <a href="qlineedit.html#editingFinished">editingFinished</a>() signal is emitted.</p>
<p>Note that if there is a validator set on the line edit, the <a href="qlineedit.html#returnPressed">returnPressed</a>()/<a href="qlineedit.html#editingFinished">editingFinished</a>() signals will only be emitted if the validator returns <a href="../qtgui/qvalidator.html#State-enum">QValidator::Acceptable</a>.</p>
<p>By default, QLineEdits have a frame as specified by platform style guides; you can turn it off by calling <a href="qlineedit.html#frame-prop">setFrame</a>(false).</p>
<p>The default key bindings are described below. The line edit also provides a context menu (usually invoked by a right mouse click) that presents some of these editing options. <a name="desc"></a></p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Keypress</th><th >Action</th></tr></thead>
<tr valign="top" class="odd"><td >Left Arrow</td><td >Moves the cursor one character to the left.</td></tr>
<tr valign="top" class="even"><td >Shift+Left Arrow</td><td >Moves and selects text one character to the left.</td></tr>
<tr valign="top" class="odd"><td >Right Arrow</td><td >Moves the cursor one character to the right.</td></tr>
<tr valign="top" class="even"><td >Shift+Right Arrow</td><td >Moves and selects text one character to the right.</td></tr>
<tr valign="top" class="odd"><td >Home</td><td >Moves the cursor to the beginning of the line.</td></tr>
<tr valign="top" class="even"><td >End</td><td >Moves the cursor to the end of the line.</td></tr>
<tr valign="top" class="odd"><td >Backspace</td><td >Deletes the character to the left of the cursor.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Backspace</td><td >Deletes the word to the left of the cursor.</td></tr>
<tr valign="top" class="odd"><td >Delete</td><td >Deletes the character to the right of the cursor.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Delete</td><td >Deletes the word to the right of the cursor.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+A</td><td >Select all.</td></tr>
<tr valign="top" class="even"><td >Ctrl+C</td><td >Copies the selected text to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Insert</td><td >Copies the selected text to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Ctrl+K</td><td >Deletes to the end of the line.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+V</td><td >Pastes the clipboard text into line edit.</td></tr>
<tr valign="top" class="even"><td >Shift+Insert</td><td >Pastes the clipboard text into line edit.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+X</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="even"><td >Shift+Delete</td><td >Deletes the selected text and copies it to the clipboard.</td></tr>
<tr valign="top" class="odd"><td >Ctrl+Z</td><td >Undoes the last operation.</td></tr>
<tr valign="top" class="even"><td >Ctrl+Y</td><td >Redoes the last undone operation.</td></tr>
</table></div>
<p>Any other key sequence that represents a valid character, will cause the character to be inserted into the line edit.</p>
</div>
<p><b>See also </b><a href="qtextedit.html">QTextEdit</a>, <a href="qlabel.html">QLabel</a>, <a href="qcombobox.html">QComboBox</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Field, Entry</a>, and <a href="qtwidgets-widgets-lineedits-example.html">Line Edits Example</a>.</p>
<!-- @@@QLineEdit -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ActionPosition$$$LeadingPosition$$$TrailingPosition -->
<h3 class="fn" id="ActionPosition-enum"><a name="ActionPosition-enum"></a>enum QLineEdit::<span class="name">ActionPosition</span></h3>
<p>This enum type describes how a line edit should display the action widgets to be added.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QLineEdit::LeadingPosition</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The widget is displayed to the left of the text when using layout direction <code>Qt::LeftToRight</code> or to the right when using <code>Qt::RightToLeft</code>, respectively.</td></tr>
<tr><td class="topAlign"><code>QLineEdit::TrailingPosition</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The widget is displayed to the right of the text when using layout direction <code>Qt::LeftToRight</code> or to the left when using <code>Qt::RightToLeft</code>, respectively.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 5.2.</p>
<p><b>See also </b><a href="qlineedit.html#addAction">addAction</a>(), <a href="qwidget.html#removeAction">removeAction</a>(), and <a href="qwidget.html#layoutDirection-prop">QWidget::layoutDirection</a>.</p>
<!-- @@@ActionPosition -->
<!-- $$$EchoMode$$$Normal$$$NoEcho$$$Password$$$PasswordEchoOnEdit -->
<h3 class="fn" id="EchoMode-enum"><a name="EchoMode-enum"></a>enum QLineEdit::<span class="name">EchoMode</span></h3>
<p>This enum type describes how a line edit should display its contents.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QLineEdit::Normal</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Display characters as they are entered. This is the default.</td></tr>
<tr><td class="topAlign"><code>QLineEdit::NoEcho</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret.</td></tr>
<tr><td class="topAlign"><code>QLineEdit::Password</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Display platform-dependent password mask characters instead of the characters actually entered.</td></tr>
<tr><td class="topAlign"><code>QLineEdit::PasswordEchoOnEdit</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Display characters as they are entered while editing otherwise display characters as with <code>Password</code>.</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#echoMode-prop">setEchoMode</a>() and <a href="qlineedit.html#echoMode-prop">echoMode</a>().</p>
<!-- @@@EchoMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$acceptableInput-prop$$$hasAcceptableInput -->
<h3 class="fn" id="acceptableInput-prop"><a name="acceptableInput-prop"></a><span class="name">acceptableInput</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the input satisfies the <a href="qlineedit.html#inputMask-prop">inputMask</a> and the validator.</p>
<p>By default, this property is <code>true</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>hasAcceptableInput</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#inputMask-prop">setInputMask</a>() and <a href="qlineedit.html#setValidator">setValidator</a>().</p>
<!-- @@@acceptableInput -->
<!-- $$$alignment-prop$$$alignment$$$setAlignmentQt::Alignment -->
<h3 class="fn" id="alignment-prop"><a name="alignment-prop"></a><span class="name">alignment</span> : <span class="type"><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a></span></h3>
<p>This property holds the alignment of the line edit.</p>
<p>Both horizontal and vertical alignment is allowed here, <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignJustify</a> will map to <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a>.</p>
<p>By default, this property contains a combination of <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignLeft</a> and <a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::AlignVCenter</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><span class="name"><b>alignment</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAlignment</b></span>(Qt::Alignment <i>flag</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="../qtcore/qt.html#AlignmentFlag-enum">Qt::Alignment</a>.</p>
<!-- @@@alignment -->
<!-- $$$clearButtonEnabled-prop$$$isClearButtonEnabled$$$setClearButtonEnabledbool -->
<h3 class="fn" id="clearButtonEnabled-prop"><a name="clearButtonEnabled-prop"></a><span class="name">clearButtonEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether the line edit displays a clear button when it is not empty.</p>
<p>If enabled, the line edit displays a trailing <i>clear</i> button when it contains some text, otherwise the line edit does not show a clear button (the default).</p>
<p>This property was introduced in  Qt 5.2.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isClearButtonEnabled</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setClearButtonEnabled</b></span>(bool <i>enable</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#addAction">addAction</a>() and <a href="qwidget.html#removeAction">removeAction</a>().</p>
<!-- @@@clearButtonEnabled -->
<!-- $$$cursorMoveStyle-prop$$$cursorMoveStyle$$$setCursorMoveStyleQt::CursorMoveStyle -->
<h3 class="fn" id="cursorMoveStyle-prop"><a name="cursorMoveStyle-prop"></a><span class="name">cursorMoveStyle</span> : <span class="type"><a href="../qtcore/qt.html#CursorMoveStyle-enum">Qt::CursorMoveStyle</a></span></h3>
<p>This property holds the movement style of cursor in this line edit.</p>
<p>When this property is set to <a href="../qtcore/qt.html#CursorMoveStyle-enum">Qt::VisualMoveStyle</a>, the line edit will use visual movement style. Pressing the left arrow key will always cause the cursor to move left, regardless of the text's writing direction. The same behavior applies to right arrow key.</p>
<p>When the property is <a href="../qtcore/qt.html#CursorMoveStyle-enum">Qt::LogicalMoveStyle</a> (the default), within a LTR text block, increase cursor position when pressing left arrow key, decrease cursor position when pressing the right arrow key. If the text block is right to left, the opposite behavior applies.</p>
<p>This property was introduced in  Qt 4.8.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::CursorMoveStyle </td><td class="memItemRight bottomAlign"><span class="name"><b>cursorMoveStyle</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCursorMoveStyle</b></span>(Qt::CursorMoveStyle <i>style</i>)</td></tr>
</table></div>
<!-- @@@cursorMoveStyle -->
<!-- $$$cursorPosition-prop$$$cursorPosition$$$setCursorPositionint -->
<h3 class="fn" id="cursorPosition-prop"><a name="cursorPosition-prop"></a><span class="name">cursorPosition</span> : <span class="type">int</span></h3>
<p>This property holds the current cursor position for this line edit.</p>
<p>Setting the cursor position causes a repaint when appropriate.</p>
<p>By default, this property contains a value of 0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>cursorPosition</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCursorPosition</b></span>(<i>int</i>)</td></tr>
</table></div>
<!-- @@@cursorPosition -->
<!-- $$$displayText-prop$$$displayText -->
<h3 class="fn" id="displayText-prop"><a name="displayText-prop"></a><span class="name">displayText</span> : const <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the displayed text.</p>
<p>If <a href="qlineedit.html#echoMode-prop">echoMode</a> is <a href="qlineedit.html#EchoMode-enum">Normal</a> this returns the same as <a href="qlineedit.html#text-prop">text</a>(); if <a href="qlineedit.html#EchoMode-enum">EchoMode</a> is <a href="qlineedit.html#EchoMode-enum">Password</a> or <a href="qlineedit.html#EchoMode-enum">PasswordEchoOnEdit</a> it returns a string of platform-dependent password mask characters <a href="qlineedit.html#text-prop">text</a>().<a href="stylesheet-reference.html#length">length</a>() in size, e.g&#x2e; &quot;******&quot;; if <a href="qlineedit.html#EchoMode-enum">EchoMode</a> is <a href="qlineedit.html#EchoMode-enum">NoEcho</a> returns an empty string, &quot;&quot;.</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>displayText</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#echoMode-prop">setEchoMode</a>(), <a href="qlineedit.html#text-prop">text</a>(), and <a href="qlineedit.html#EchoMode-enum">EchoMode</a>.</p>
<!-- @@@displayText -->
<!-- $$$dragEnabled-prop$$$dragEnabled$$$setDragEnabledbool -->
<h3 class="fn" id="dragEnabled-prop"><a name="dragEnabled-prop"></a><span class="name">dragEnabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether the lineedit starts a drag if the user presses and moves the mouse on some selected text.</p>
<p>Dragging is disabled by default.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>dragEnabled</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDragEnabled</b></span>(bool <i>b</i>)</td></tr>
</table></div>
<!-- @@@dragEnabled -->
<!-- $$$echoMode-prop$$$echoMode$$$setEchoModeQLineEdit::EchoMode -->
<h3 class="fn" id="echoMode-prop"><a name="echoMode-prop"></a><span class="name">echoMode</span> : <span class="type"><a href="qlineedit.html#EchoMode-enum">EchoMode</a></span></h3>
<p>This property holds the line edit's echo mode.</p>
<p>The echo mode determines how the text entered in the line edit is displayed (or echoed) to the user.</p>
<p>The most common setting is <a href="qlineedit.html#EchoMode-enum">Normal</a>, in which the text entered by the user is displayed verbatim, but <a href="qlineedit.html">QLineEdit</a> also supports modes that allow the entered text to be suppressed or obscured: these include <a href="qlineedit.html#EchoMode-enum">NoEcho</a>, <a href="qlineedit.html#EchoMode-enum">Password</a> and <a href="qlineedit.html#EchoMode-enum">PasswordEchoOnEdit</a>.</p>
<p>The widget's display and the ability to copy or drag the text is affected by this setting.</p>
<p>By default, this property is set to <a href="qlineedit.html#EchoMode-enum">Normal</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QLineEdit::EchoMode </td><td class="memItemRight bottomAlign"><span class="name"><b>echoMode</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setEchoMode</b></span>(<i>QLineEdit::EchoMode</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#EchoMode-enum">EchoMode</a> and <a href="qlineedit.html#displayText-prop">displayText</a>().</p>
<!-- @@@echoMode -->
<!-- $$$frame-prop$$$hasFrame$$$setFramebool -->
<h3 class="fn" id="frame-prop"><a name="frame-prop"></a><span class="name">frame</span> : <span class="type">bool</span></h3>
<p>This property holds whether the line edit draws itself with a frame.</p>
<p>If enabled (the default) the line edit draws itself inside a frame, otherwise the line edit draws itself without any frame.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>hasFrame</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFrame</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@frame -->
<!-- $$$hasSelectedText-prop$$$hasSelectedText -->
<h3 class="fn" id="hasSelectedText-prop"><a name="hasSelectedText-prop"></a><span class="name">hasSelectedText</span> : const <span class="type">bool</span></h3>
<p>This property holds whether there is any text selected.</p>
<p>hasSelectedText() returns <code>true</code> if some or all of the text has been selected by the user; otherwise returns <code>false</code>.</p>
<p>By default, this property is <code>false</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>hasSelectedText</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#selectedText-prop">selectedText</a>().</p>
<!-- @@@hasSelectedText -->
<!-- $$$inputMask-prop$$$inputMask$$$setInputMaskconstQString& -->
<h3 class="fn" id="inputMask-prop"><a name="inputMask-prop"></a><span class="name">inputMask</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the validation input mask.</p>
<p>If no mask is set, inputMask() returns an empty string.</p>
<p>Sets the <a href="qlineedit.html">QLineEdit</a>'s validation mask. Validators can be used instead of, or in conjunction with masks; see <a href="qlineedit.html#setValidator">setValidator</a>().</p>
<p>Unset the mask and return to normal <a href="qlineedit.html">QLineEdit</a> operation by passing an empty string (&quot;&quot;).</p>
<p>The table below shows the characters that can be used in an input mask. A space character, the default character for a blank, is needed for cases where a character is <i>permitted but not required</i>.</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Character</th><th >Meaning</th></tr></thead>
<tr valign="top" class="odd"><td ><code>A</code></td><td >ASCII alphabetic character required. A-Z, a-z.</td></tr>
<tr valign="top" class="even"><td ><code>a</code></td><td >ASCII alphabetic character permitted but not required.</td></tr>
<tr valign="top" class="odd"><td ><code>N</code></td><td >ASCII alphanumeric character required. A-Z, a-z, 0-9.</td></tr>
<tr valign="top" class="even"><td ><code>n</code></td><td >ASCII alphanumeric character permitted but not required.</td></tr>
<tr valign="top" class="odd"><td ><code>X</code></td><td >Any character required.</td></tr>
<tr valign="top" class="even"><td ><code>x</code></td><td >Any character permitted but not required.</td></tr>
<tr valign="top" class="odd"><td ><code>9</code></td><td >ASCII digit required. 0-9.</td></tr>
<tr valign="top" class="even"><td ><code>0</code></td><td >ASCII digit permitted but not required.</td></tr>
<tr valign="top" class="odd"><td ><code>D</code></td><td >ASCII digit required. 1-9.</td></tr>
<tr valign="top" class="even"><td ><code>d</code></td><td >ASCII digit permitted but not required (1-9).</td></tr>
<tr valign="top" class="odd"><td ><code>#</code></td><td >ASCII digit or plus/minus sign permitted but not required.</td></tr>
<tr valign="top" class="even"><td ><code>H</code></td><td >Hexadecimal character required. A-F, a-f, 0-9.</td></tr>
<tr valign="top" class="odd"><td ><code>h</code></td><td >Hexadecimal character permitted but not required.</td></tr>
<tr valign="top" class="even"><td ><code>B</code></td><td >Binary character required. 0-1.</td></tr>
<tr valign="top" class="odd"><td ><code>b</code></td><td >Binary character permitted but not required.</td></tr>
<tr valign="top" class="even"><td ><code>&gt;</code></td><td >All following alphabetic characters are uppercased.</td></tr>
<tr valign="top" class="odd"><td ><code>&lt;</code></td><td >All following alphabetic characters are lowercased.</td></tr>
<tr valign="top" class="even"><td ><code>!</code></td><td >Switch off case conversion.</td></tr>
<tr valign="top" class="odd"><td ><code>[ ] { }</code></td><td >Reserved.</td></tr>
<tr valign="top" class="even"><td ><code>\</code></td><td >Use <code>\</code> to escape the special characters listed above to use them as separators.</td></tr>
</table></div>
<p>The mask consists of a string of mask characters and separators, optionally followed by a semicolon and the character used for blanks. The blank characters are always removed from the text after editing.</p>
<p>Examples:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Mask</th><th >Notes</th></tr></thead>
<tr valign="top" class="odd"><td ><code>000.000.000.000;_</code></td><td >IP address; blanks are <code>_</code>.</td></tr>
<tr valign="top" class="even"><td ><code>HH:HH:HH:HH:HH:HH;_</code></td><td >MAC address</td></tr>
<tr valign="top" class="odd"><td ><code>0000-00-00</code></td><td >ISO Date; blanks are <code>space</code></td></tr>
<tr valign="top" class="even"><td ><code>&gt;AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#</code></td><td >License number; blanks are <code>-</code> and all (alphabetic) characters are converted to uppercase.</td></tr>
</table></div>
<p>To get range control (e.g&#x2e;, for an IP address) use masks together with <a href="qlineedit.html#setValidator">validators</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>inputMask</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setInputMask</b></span>(const QString &amp;<i>inputMask</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#maxLength-prop">maxLength</a>.</p>
<!-- @@@inputMask -->
<!-- $$$maxLength-prop$$$maxLength$$$setMaxLengthint -->
<h3 class="fn" id="maxLength-prop"><a name="maxLength-prop"></a><span class="name">maxLength</span> : <span class="type">int</span></h3>
<p>This property holds the maximum permitted length of the text.</p>
<p>If the text is too long, it is truncated at the limit.</p>
<p>If truncation occurs any selected text will be unselected, the cursor position is set to 0 and the first part of the string is shown.</p>
<p>If the line edit has an input mask, the mask defines the maximum string length.</p>
<p>By default, this property contains a value of 32767.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>maxLength</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMaxLength</b></span>(<i>int</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#inputMask-prop">inputMask</a>.</p>
<!-- @@@maxLength -->
<!-- $$$modified-prop$$$isModified$$$setModifiedbool -->
<h3 class="fn" id="modified-prop"><a name="modified-prop"></a><span class="name">modified</span> : <span class="type">bool</span></h3>
<p>This property holds whether the line edit's contents has been modified by the user.</p>
<p>The modified flag is never read by <a href="qlineedit.html">QLineEdit</a>; it has a default value of false and is changed to true whenever the user changes the line edit's contents.</p>
<p>This is useful for things that need to provide a default value but do not start out knowing what the default should be (perhaps it depends on other fields on the form). Start the line edit without the best default, and when the default is known, if modified() returns <code>false</code> (the user hasn't entered any text), insert the default value.</p>
<p>Calling <a href="qlineedit.html#text-prop">setText</a>() resets the modified flag to false.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isModified</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setModified</b></span>(<i>bool</i>)</td></tr>
</table></div>
<!-- @@@modified -->
<!-- $$$placeholderText-prop$$$placeholderText$$$setPlaceholderTextconstQString& -->
<h3 class="fn" id="placeholderText-prop"><a name="placeholderText-prop"></a><span class="name">placeholderText</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the line edit's placeholder text.</p>
<p>Setting this property makes the line edit display a grayed-out placeholder text as long as the line edit is empty.</p>
<p>Normally, an empty line edit shows the placeholder text even when it has focus. However, if the content is horizontally centered, the placeholder text is not displayed under the cursor when the line edit has focus.</p>
<p>By default, this property contains an empty string.</p>
<p>This property was introduced in  Qt 4.7.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>placeholderText</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPlaceholderText</b></span>(<i>const QString &amp;</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#text-prop">text</a>().</p>
<!-- @@@placeholderText -->
<!-- $$$readOnly-prop$$$isReadOnly$$$setReadOnlybool -->
<h3 class="fn" id="readOnly-prop"><a name="readOnly-prop"></a><span class="name">readOnly</span> : <span class="type">bool</span></h3>
<p>This property holds whether the line edit is read only.</p>
<p>In read-only mode, the user can still copy the text to the clipboard, or drag and drop the text (if <a href="qlineedit.html#echoMode-prop">echoMode</a>() is <a href="qlineedit.html#EchoMode-enum">Normal</a>), but cannot edit it.</p>
<p><a href="qlineedit.html">QLineEdit</a> does not show a cursor in read-only mode.</p>
<p>By default, this property is <code>false</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isReadOnly</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setReadOnly</b></span>(<i>bool</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qwidget.html#enabled-prop">setEnabled</a>().</p>
<!-- @@@readOnly -->
<!-- $$$redoAvailable-prop$$$isRedoAvailable -->
<h3 class="fn" id="redoAvailable-prop"><a name="redoAvailable-prop"></a><span class="name">redoAvailable</span> : const <span class="type">bool</span></h3>
<p>This property holds whether redo is available.</p>
<p>Redo becomes available once the user has performed one or more undo operations on text in the line edit.</p>
<p>By default, this property is <code>false</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isRedoAvailable</b></span>() const</td></tr>
</table></div>
<!-- @@@redoAvailable -->
<!-- $$$selectedText-prop$$$selectedText -->
<h3 class="fn" id="selectedText-prop"><a name="selectedText-prop"></a><span class="name">selectedText</span> : const <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the selected text.</p>
<p>If there is no selected text this property's value is an empty string.</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>selectedText</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#hasSelectedText-prop">hasSelectedText</a>().</p>
<!-- @@@selectedText -->
<!-- $$$text-prop$$$text$$$setTextconstQString&$$$textChangedconstQString& -->
<h3 class="fn" id="text-prop"><a name="text-prop"></a><span class="name">text</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>This property holds the line edit's text.</p>
<p>Setting this property clears the selection, clears the undo/redo history, moves the cursor to the end of the line and resets the <a href="qlineedit.html#modified-prop">modified</a> property to false. The text is not validated when inserted with setText().</p>
<p>The text is truncated to <a href="qlineedit.html#maxLength-prop">maxLength</a>() length.</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>text</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setText</b></span>(<i>const QString &amp;</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qlineedit.html#textChanged">textChanged</a></b></span>(const QString &amp;<i>text</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qlineedit.html#insert">insert</a>() and <a href="qlineedit.html#clear">clear</a>().</p>
<!-- @@@text -->
<!-- $$$undoAvailable-prop$$$isUndoAvailable -->
<h3 class="fn" id="undoAvailable-prop"><a name="undoAvailable-prop"></a><span class="name">undoAvailable</span> : const <span class="type">bool</span></h3>
<p>This property holds whether undo is available.</p>
<p>Undo becomes available once the user has modified the text in the line edit.</p>
<p>By default, this property is <code>false</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isUndoAvailable</b></span>() const</td></tr>
</table></div>
<!-- @@@undoAvailable -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QLineEdit[overload1]$$$QLineEditQWidget* -->
<h3 class="fn" id="QLineEdit"><a name="QLineEdit"></a>QLineEdit::<span class="name">QLineEdit</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a line edit with no text.</p>
<p>The maximum text length is set to 32767 characters.</p>
<p>The <i>parent</i> argument is sent to the <a href="qwidget.html">QWidget</a> constructor.</p>
<p><b>See also </b><a href="qlineedit.html#text-prop">setText</a>() and <a href="qlineedit.html#maxLength-prop">setMaxLength</a>().</p>
<!-- @@@QLineEdit -->
<!-- $$$QLineEdit$$$QLineEditconstQString&QWidget* -->
<h3 class="fn" id="QLineEdit-1"><a name="QLineEdit-1"></a>QLineEdit::<span class="name">QLineEdit</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>contents</i>, <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs a line edit containing the text <i>contents</i>.</p>
<p>The cursor position is set to the end of the line and the maximum text length to 32767 characters.</p>
<p>The <i>parent</i> and argument is sent to the <a href="qwidget.html">QWidget</a> constructor.</p>
<p><b>See also </b><a href="qlineedit.html#text-prop">text</a>() and <a href="qlineedit.html#maxLength-prop">setMaxLength</a>().</p>
<!-- @@@QLineEdit -->
<!-- $$$~QLineEdit[overload1]$$$~QLineEdit -->
<h3 class="fn" id="dtor.QLineEdit"><a name="dtor.QLineEdit"></a><code>[virtual] </code>QLineEdit::<span class="name">~QLineEdit</span>()</h3>
<p>Destroys the line edit.</p>
<!-- @@@~QLineEdit -->
<!-- $$$addAction[overload1]$$$addActionQAction*QLineEdit::ActionPosition -->
<h3 class="fn" id="addAction"><a name="addAction"></a><span class="type">void</span> QLineEdit::<span class="name">addAction</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<i>action</i>, <span class="type"><a href="qlineedit.html#ActionPosition-enum">QLineEdit::ActionPosition</a></span> <i>position</i>)</h3>
<p>Adds the <i>action</i> to the list of actions at the <i>position</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@addAction -->
<!-- $$$addAction$$$addActionconstQIcon&QLineEdit::ActionPosition -->
<h3 class="fn" id="addAction-1"><a name="addAction-1"></a><span class="type"><a href="qaction.html">QAction</a></span> *QLineEdit::<span class="name">addAction</span>(const <span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> &amp;<i>icon</i>, <span class="type"><a href="qlineedit.html#ActionPosition-enum">QLineEdit::ActionPosition</a></span> <i>position</i>)</h3>
<p>This is an overloaded function.</p>
<p>Creates a new action with the given <i>icon</i> at the <i>position</i>.</p>
<p>This function was introduced in  Qt 5.2.</p>
<!-- @@@addAction -->
<!-- $$$backspace[overload1]$$$backspace -->
<h3 class="fn" id="backspace"><a name="backspace"></a><span class="type">void</span> QLineEdit::<span class="name">backspace</span>()</h3>
<p>If no text is selected, deletes the character to the left of the text cursor and moves the cursor one position to the left. If any text is selected, the cursor is moved to the beginning of the selected text and the selected text is deleted.</p>
<p><b>See also </b><a href="qlineedit.html#del">del</a>().</p>
<!-- @@@backspace -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">clear</span>()</h3>
<p>Clears the contents of the line edit.</p>
<p><b>See also </b><a href="qlineedit.html#text-prop">setText</a>() and <a href="qlineedit.html#insert">insert</a>().</p>
<!-- @@@clear -->
<!-- $$$completer[overload1]$$$completer -->
<h3 class="fn" id="completer"><a name="completer"></a><span class="type"><a href="qcompleter.html">QCompleter</a></span> *QLineEdit::<span class="name">completer</span>() const</h3>
<p>Returns the current <a href="qcompleter.html">QCompleter</a> that provides completions.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qlineedit.html#setCompleter">setCompleter</a>().</p>
<!-- @@@completer -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQContextMenuEvent* -->
<h3 class="fn" id="contextMenuEvent"><a name="contextMenuEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">contextMenuEvent</span>(<span class="type"><a href="../qtgui/qcontextmenuevent.html">QContextMenuEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#contextMenuEvent">QWidget::contextMenuEvent</a>().</p>
<p>Shows the standard context menu created with <a href="qlineedit.html#createStandardContextMenu">createStandardContextMenu</a>().</p>
<p>If you do not want the line edit to have a context menu, you can set its <a href="qwidget.html#contextMenuPolicy-prop">contextMenuPolicy</a> to <a href="../qtcore/qt.html#ContextMenuPolicy-enum">Qt::NoContextMenu</a>. If you want to customize the context menu, reimplement this function. If you want to extend the standard context menu, reimplement this function, call <a href="qlineedit.html#createStandardContextMenu">createStandardContextMenu</a>() and extend the menu returned.</p>
<pre class="cpp">

  <span class="type">void</span> LineEdit<span class="operator">::</span>contextMenuEvent(<span class="type"><a href="../qtgui/qcontextmenuevent.html">QContextMenuEvent</a></span> <span class="operator">*</span>event)
  {
      <span class="type"><a href="qmenu.html">QMenu</a></span> <span class="operator">*</span>menu <span class="operator">=</span> createStandardContextMenu();
      menu<span class="operator">-</span><span class="operator">&gt;</span>addAction(tr(<span class="string">&quot;My Menu Item&quot;</span>));
      <span class="comment">//...</span>
      menu<span class="operator">-</span><span class="operator">&gt;</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>globalPos());
      <span class="keyword">delete</span> menu;
  }

</pre>
<p>The <i>event</i> parameter is used to obtain the position where the mouse cursor was when the event was generated.</p>
<p><b>See also </b><a href="qwidget.html#contextMenuPolicy-prop">setContextMenuPolicy</a>().</p>
<!-- @@@contextMenuEvent -->
<!-- $$$copy[overload1]$$$copy -->
<h3 class="fn" id="copy"><a name="copy"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">copy</span>() const</h3>
<p>Copies the selected text to the clipboard, if there is any, and if <a href="qlineedit.html#echoMode-prop">echoMode</a>() is <a href="qlineedit.html#EchoMode-enum">Normal</a>.</p>
<p><b>See also </b><a href="qlineedit.html#cut">cut</a>() and <a href="qlineedit.html#paste">paste</a>().</p>
<!-- @@@copy -->
<!-- $$$createStandardContextMenu[overload1]$$$createStandardContextMenu -->
<h3 class="fn" id="createStandardContextMenu"><a name="createStandardContextMenu"></a><span class="type"><a href="qmenu.html">QMenu</a></span> *QLineEdit::<span class="name">createStandardContextMenu</span>()</h3>
<p>This function creates the standard context menu which is shown when the user clicks on the line edit with the right mouse button. It is called from the default <a href="qlineedit.html#contextMenuEvent">contextMenuEvent</a>() handler. The popup menu's ownership is transferred to the caller.</p>
<!-- @@@createStandardContextMenu -->
<!-- $$$cursorBackward[overload1]$$$cursorBackwardboolint -->
<h3 class="fn" id="cursorBackward"><a name="cursorBackward"></a><span class="type">void</span> QLineEdit::<span class="name">cursorBackward</span>(<span class="type">bool</span> <i>mark</i>, <span class="type">int</span> <i>steps</i> = 1)</h3>
<p>Moves the cursor back <i>steps</i> characters. If <i>mark</i> is true each character moved over is added to the selection; if <i>mark</i> is false the selection is cleared.</p>
<p><b>See also </b><a href="qlineedit.html#cursorForward">cursorForward</a>().</p>
<!-- @@@cursorBackward -->
<!-- $$$cursorForward[overload1]$$$cursorForwardboolint -->
<h3 class="fn" id="cursorForward"><a name="cursorForward"></a><span class="type">void</span> QLineEdit::<span class="name">cursorForward</span>(<span class="type">bool</span> <i>mark</i>, <span class="type">int</span> <i>steps</i> = 1)</h3>
<p>Moves the cursor forward <i>steps</i> characters. If <i>mark</i> is true each character moved over is added to the selection; if <i>mark</i> is false the selection is cleared.</p>
<p><b>See also </b><a href="qlineedit.html#cursorBackward">cursorBackward</a>().</p>
<!-- @@@cursorForward -->
<!-- $$$cursorPositionAt[overload1]$$$cursorPositionAtconstQPoint& -->
<h3 class="fn" id="cursorPositionAt"><a name="cursorPositionAt"></a><span class="type">int</span> QLineEdit::<span class="name">cursorPositionAt</span>(const <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> &amp;<i>pos</i>)</h3>
<p>Returns the cursor position under the point <i>pos</i>.</p>
<!-- @@@cursorPositionAt -->
<!-- $$$cursorPositionChanged[overload1]$$$cursorPositionChangedintint -->
<h3 class="fn" id="cursorPositionChanged"><a name="cursorPositionChanged"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">cursorPositionChanged</span>(<span class="type">int</span> <i>oldPos</i>, <span class="type">int</span> <i>newPos</i>)</h3>
<p>This signal is emitted whenever the cursor moves. The previous position is given by <i>oldPos</i>, and the new position by <i>newPos</i>.</p>
<p><b>See also </b><a href="qlineedit.html#cursorPosition-prop">setCursorPosition</a>() and <a href="qlineedit.html#cursorPosition-prop">cursorPosition</a>().</p>
<!-- @@@cursorPositionChanged -->
<!-- $$$cursorRect[overload1]$$$cursorRect -->
<h3 class="fn" id="cursorRect"><a name="cursorRect"></a><code>[protected] </code><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QLineEdit::<span class="name">cursorRect</span>() const</h3>
<p>Returns a rectangle that includes the lineedit cursor.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@cursorRect -->
<!-- $$$cursorWordBackward[overload1]$$$cursorWordBackwardbool -->
<h3 class="fn" id="cursorWordBackward"><a name="cursorWordBackward"></a><span class="type">void</span> QLineEdit::<span class="name">cursorWordBackward</span>(<span class="type">bool</span> <i>mark</i>)</h3>
<p>Moves the cursor one word backward. If <i>mark</i> is true, the word is also selected.</p>
<p><b>See also </b><a href="qlineedit.html#cursorWordForward">cursorWordForward</a>().</p>
<!-- @@@cursorWordBackward -->
<!-- $$$cursorWordForward[overload1]$$$cursorWordForwardbool -->
<h3 class="fn" id="cursorWordForward"><a name="cursorWordForward"></a><span class="type">void</span> QLineEdit::<span class="name">cursorWordForward</span>(<span class="type">bool</span> <i>mark</i>)</h3>
<p>Moves the cursor one word forward. If <i>mark</i> is true, the word is also selected.</p>
<p><b>See also </b><a href="qlineedit.html#cursorWordBackward">cursorWordBackward</a>().</p>
<!-- @@@cursorWordForward -->
<!-- $$$cut[overload1]$$$cut -->
<h3 class="fn" id="cut"><a name="cut"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">cut</span>()</h3>
<p>Copies the selected text to the clipboard and deletes it, if there is any, and if <a href="qlineedit.html#echoMode-prop">echoMode</a>() is <a href="qlineedit.html#EchoMode-enum">Normal</a>.</p>
<p>If the current validator disallows deleting the selected text, cut() will copy without deleting.</p>
<p><b>See also </b><a href="qlineedit.html#copy">copy</a>(), <a href="qlineedit.html#paste">paste</a>(), and <a href="qlineedit.html#setValidator">setValidator</a>().</p>
<!-- @@@cut -->
<!-- $$$del[overload1]$$$del -->
<h3 class="fn" id="del"><a name="del"></a><span class="type">void</span> QLineEdit::<span class="name">del</span>()</h3>
<p>If no text is selected, deletes the character to the right of the text cursor. If any text is selected, the cursor is moved to the beginning of the selected text and the selected text is deleted.</p>
<p><b>See also </b><a href="qlineedit.html#backspace">backspace</a>().</p>
<!-- @@@del -->
<!-- $$$deselect[overload1]$$$deselect -->
<h3 class="fn" id="deselect"><a name="deselect"></a><span class="type">void</span> QLineEdit::<span class="name">deselect</span>()</h3>
<p>Deselects any selected text.</p>
<p><b>See also </b><a href="qlineedit.html#setSelection">setSelection</a>() and <a href="qlineedit.html#selectAll">selectAll</a>().</p>
<!-- @@@deselect -->
<!-- $$$dragEnterEvent[overload1]$$$dragEnterEventQDragEnterEvent* -->
<h3 class="fn" id="dragEnterEvent"><a name="dragEnterEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">dragEnterEvent</span>(<span class="type"><a href="../qtgui/qdragenterevent.html">QDragEnterEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#dragEnterEvent">QWidget::dragEnterEvent</a>().</p>
<!-- @@@dragEnterEvent -->
<!-- $$$dragLeaveEvent[overload1]$$$dragLeaveEventQDragLeaveEvent* -->
<h3 class="fn" id="dragLeaveEvent"><a name="dragLeaveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">dragLeaveEvent</span>(<span class="type"><a href="../qtgui/qdragleaveevent.html">QDragLeaveEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#dragLeaveEvent">QWidget::dragLeaveEvent</a>().</p>
<!-- @@@dragLeaveEvent -->
<!-- $$$dragMoveEvent[overload1]$$$dragMoveEventQDragMoveEvent* -->
<h3 class="fn" id="dragMoveEvent"><a name="dragMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">dragMoveEvent</span>(<span class="type"><a href="../qtgui/qdragmoveevent.html">QDragMoveEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#dragMoveEvent">QWidget::dragMoveEvent</a>().</p>
<!-- @@@dragMoveEvent -->
<!-- $$$dropEvent[overload1]$$$dropEventQDropEvent* -->
<h3 class="fn" id="dropEvent"><a name="dropEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">dropEvent</span>(<span class="type"><a href="../qtgui/qdropevent.html">QDropEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#dropEvent">QWidget::dropEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$editingFinished[overload1]$$$editingFinished -->
<h3 class="fn" id="editingFinished"><a name="editingFinished"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">editingFinished</span>()</h3>
<p>This signal is emitted when the Return or Enter key is pressed or the line edit loses focus. Note that if there is a <a href="qlineedit.html#validator">validator</a>() or <a href="qlineedit.html#inputMask-prop">inputMask</a>() set on the line edit and enter/return is pressed, the editingFinished() signal will only be emitted if the input follows the <a href="qlineedit.html#inputMask-prop">inputMask</a>() and the <a href="qlineedit.html#validator">validator</a>() returns <a href="../qtgui/qvalidator.html#State-enum">QValidator::Acceptable</a>.</p>
<!-- @@@editingFinished -->
<!-- $$$end[overload1]$$$endbool -->
<h3 class="fn" id="end"><a name="end"></a><span class="type">void</span> QLineEdit::<span class="name">end</span>(<span class="type">bool</span> <i>mark</i>)</h3>
<p>Moves the text cursor to the end of the line unless it is already there. If <i>mark</i> is true, text is selected towards the last position; otherwise, any selected text is unselected if the cursor is moved.</p>
<p><b>See also </b><a href="qlineedit.html#home">home</a>().</p>
<!-- @@@end -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual] </code><span class="type">bool</span> QLineEdit::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#event">QWidget::event</a>().</p>
<!-- @@@event -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$getTextMargins[overload1]$$$getTextMarginsint*int*int*int* -->
<h3 class="fn" id="getTextMargins"><a name="getTextMargins"></a><span class="type">void</span> QLineEdit::<span class="name">getTextMargins</span>(<span class="type">int</span> *<i>left</i>, <span class="type">int</span> *<i>top</i>, <span class="type">int</span> *<i>right</i>, <span class="type">int</span> *<i>bottom</i>) const</h3>
<p>Returns the widget's text margins for <i>left</i>, <i>top</i>, <i>right</i>, and <i>bottom</i>.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qlineedit.html#setTextMargins">setTextMargins</a>().</p>
<!-- @@@getTextMargins -->
<!-- $$$home[overload1]$$$homebool -->
<h3 class="fn" id="home"><a name="home"></a><span class="type">void</span> QLineEdit::<span class="name">home</span>(<span class="type">bool</span> <i>mark</i>)</h3>
<p>Moves the text cursor to the beginning of the line unless it is already there. If <i>mark</i> is true, text is selected towards the first position; otherwise, any selected text is unselected if the cursor is moved.</p>
<p><b>See also </b><a href="qlineedit.html#end">end</a>().</p>
<!-- @@@home -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionFrame* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[protected] </code><span class="type">void</span> QLineEdit::<span class="name">initStyleOption</span>(<span class="type"><a href="qstyleoptionframe.html">QStyleOptionFrame</a></span> *<i>option</i>) const</h3>
<p>Initialize <i>option</i> with the values from this <a href="qlineedit.html">QLineEdit</a>. This method is useful for subclasses when they need a <a href="qstyleoptionframe.html">QStyleOptionFrame</a>, but don't want to fill in all the information themselves.</p>
<p><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn" id="inputMethodEvent"><a name="inputMethodEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">inputMethodEvent</span>(<span class="type"><a href="../qtgui/qinputmethodevent.html">QInputMethodEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodEvent">QWidget::inputMethodEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn" id="inputMethodQuery"><a name="inputMethodQuery"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QLineEdit::<span class="name">inputMethodQuery</span>(<span class="type"><a href="../qtcore/qt.html#InputMethodQuery-enum">Qt::InputMethodQuery</a></span> <i>property</i>) const</h3>
<p>Reimplemented from <a href="qwidget.html#inputMethodQuery">QWidget::inputMethodQuery</a>().</p>
<!-- @@@inputMethodQuery -->
<!-- $$$inputRejected[overload1]$$$inputRejected -->
<h3 class="fn" id="inputRejected"><a name="inputRejected"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">inputRejected</span>()</h3>
<p>This signal is emitted when the user presses a key that is not considered to be acceptable input. For example, if a key press results in a validator's validate() call to return Invalid. Another case is when trying to enter in more characters beyond the maximum length of the line edit.</p>
<p>Note: This signal will still be emitted in a case where part of the text is accepted but not all of it is. For example, if there is a maximum length set and the clipboard text is longer than the maximum length when it is pasted.</p>
<p>This function was introduced in  Qt 5.12.</p>
<!-- @@@inputRejected -->
<!-- $$$insert[overload1]$$$insertconstQString& -->
<h3 class="fn" id="insert"><a name="insert"></a><span class="type">void</span> QLineEdit::<span class="name">insert</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>newText</i>)</h3>
<p>Deletes any selected text, inserts <i>newText</i>, and validates the result. If it is valid, it sets it as the new contents of the line edit.</p>
<p><b>See also </b><a href="qlineedit.html#text-prop">setText</a>() and <a href="qlineedit.html#clear">clear</a>().</p>
<!-- @@@insert -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<p>Converts the given key press <i>event</i> into a line edit action.</p>
<p>If Return or Enter is pressed and the current text is valid (or can be <a href="../qtgui/qvalidator.html#fixup">made valid</a> by the validator), the signal <a href="qlineedit.html#returnPressed">returnPressed</a>() is emitted.</p>
<p>The default key bindings are listed in the class's detailed description.</p>
<!-- @@@keyPressEvent -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn" id="minimumSizeHint"><a name="minimumSizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QLineEdit::<span class="name">minimumSizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<p>Returns a minimum size for the line edit.</p>
<p>The width returned is enough for at least one character.</p>
<!-- @@@minimumSizeHint -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQMouseEvent* -->
<h3 class="fn" id="mouseDoubleClickEvent"><a name="mouseDoubleClickEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">mouseDoubleClickEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mouseDoubleClickEvent">QWidget::mouseDoubleClickEvent</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">mousePressEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QLineEdit::<span class="name">paintEvent</span>(<i>QPaintEvent *</i>)</h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$paste[overload1]$$$paste -->
<h3 class="fn" id="paste"><a name="paste"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">paste</span>()</h3>
<p>Inserts the clipboard's text at the cursor position, deleting any selected text, providing the line edit is not <a href="qlineedit.html#readOnly-prop">read-only</a>.</p>
<p>If the end result would not be acceptable to the current <a href="qlineedit.html#setValidator">validator</a>, nothing happens.</p>
<p><b>See also </b><a href="qlineedit.html#copy">copy</a>() and <a href="qlineedit.html#cut">cut</a>().</p>
<!-- @@@paste -->
<!-- $$$redo[overload1]$$$redo -->
<h3 class="fn" id="redo"><a name="redo"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">redo</span>()</h3>
<p>Redoes the last operation if redo is <a href="qlineedit.html#redoAvailable-prop">available</a>.</p>
<!-- @@@redo -->
<!-- $$$returnPressed[overload1]$$$returnPressed -->
<h3 class="fn" id="returnPressed"><a name="returnPressed"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">returnPressed</span>()</h3>
<p>This signal is emitted when the Return or Enter key is pressed. Note that if there is a <a href="qlineedit.html#validator">validator</a>() or <a href="qlineedit.html#inputMask-prop">inputMask</a>() set on the line edit, the returnPressed() signal will only be emitted if the input follows the <a href="qlineedit.html#inputMask-prop">inputMask</a>() and the <a href="qlineedit.html#validator">validator</a>() returns <a href="../qtgui/qvalidator.html#State-enum">QValidator::Acceptable</a>.</p>
<!-- @@@returnPressed -->
<!-- $$$selectAll[overload1]$$$selectAll -->
<h3 class="fn" id="selectAll"><a name="selectAll"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">selectAll</span>()</h3>
<p>Selects all the text (i.e&#x2e; highlights it) and moves the cursor to the end. This is useful when a default value has been inserted because if the user types before clicking on the widget, the selected text will be deleted.</p>
<p><b>See also </b><a href="qlineedit.html#setSelection">setSelection</a>() and <a href="qlineedit.html#deselect">deselect</a>().</p>
<!-- @@@selectAll -->
<!-- $$$selectionChanged[overload1]$$$selectionChanged -->
<h3 class="fn" id="selectionChanged"><a name="selectionChanged"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">selectionChanged</span>()</h3>
<p>This signal is emitted whenever the selection changes.</p>
<p><b>See also </b><a href="qlineedit.html#hasSelectedText-prop">hasSelectedText</a>() and <a href="qlineedit.html#selectedText-prop">selectedText</a>().</p>
<!-- @@@selectionChanged -->
<!-- $$$selectionEnd[overload1]$$$selectionEnd -->
<h3 class="fn" id="selectionEnd"><a name="selectionEnd"></a><span class="type">int</span> QLineEdit::<span class="name">selectionEnd</span>() const</h3>
<p>Returns the index of the character directly after the selection in the line edit or -1 if no text is selected.</p>
<p>This function was introduced in  Qt 5.10.</p>
<p><b>See also </b><a href="qlineedit.html#selectedText-prop">selectedText</a>(), <a href="qlineedit.html#selectionStart">selectionStart</a>(), and <a href="qlineedit.html#selectionLength">selectionLength</a>().</p>
<!-- @@@selectionEnd -->
<!-- $$$selectionLength[overload1]$$$selectionLength -->
<h3 class="fn" id="selectionLength"><a name="selectionLength"></a><span class="type">int</span> QLineEdit::<span class="name">selectionLength</span>() const</h3>
<p>Returns the length of the selection.</p>
<p>This function was introduced in  Qt 5.10.</p>
<p><b>See also </b><a href="qlineedit.html#selectedText-prop">selectedText</a>(), <a href="qlineedit.html#selectionStart">selectionStart</a>(), and <a href="qlineedit.html#selectionEnd">selectionEnd</a>().</p>
<!-- @@@selectionLength -->
<!-- $$$selectionStart[overload1]$$$selectionStart -->
<h3 class="fn" id="selectionStart"><a name="selectionStart"></a><span class="type">int</span> QLineEdit::<span class="name">selectionStart</span>() const</h3>
<p>Returns the index of the first selected character in the line edit or -1 if no text is selected.</p>
<p><b>See also </b><a href="qlineedit.html#selectedText-prop">selectedText</a>(), <a href="qlineedit.html#selectionEnd">selectionEnd</a>(), and <a href="qlineedit.html#selectionLength">selectionLength</a>().</p>
<!-- @@@selectionStart -->
<!-- $$$setCompleter[overload1]$$$setCompleterQCompleter* -->
<h3 class="fn" id="setCompleter"><a name="setCompleter"></a><span class="type">void</span> QLineEdit::<span class="name">setCompleter</span>(<span class="type"><a href="qcompleter.html">QCompleter</a></span> *<i>c</i>)</h3>
<p>Sets this line edit to provide auto completions from the completer, <i>c</i>. The completion mode is set using <a href="qcompleter.html#completionMode-prop">QCompleter::setCompletionMode</a>().</p>
<p>To use a <a href="qcompleter.html">QCompleter</a> with a <a href="../qtgui/qvalidator.html">QValidator</a> or <a href="qlineedit.html#inputMask-prop">QLineEdit::inputMask</a>, you need to ensure that the model provided to <a href="qcompleter.html">QCompleter</a> contains valid entries. You can use the <a href="../qtcore/qsortfilterproxymodel.html">QSortFilterProxyModel</a> to ensure that the <a href="qcompleter.html">QCompleter</a>'s model contains only valid entries.</p>
<p>If <i>c</i> == 0, setCompleter() removes the current completer, effectively disabling auto completion.</p>
<p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qlineedit.html#completer">completer</a>() and <a href="qcompleter.html">QCompleter</a>.</p>
<!-- @@@setCompleter -->
<!-- $$$setSelection[overload1]$$$setSelectionintint -->
<h3 class="fn" id="setSelection"><a name="setSelection"></a><span class="type">void</span> QLineEdit::<span class="name">setSelection</span>(<span class="type">int</span> <i>start</i>, <span class="type">int</span> <i>length</i>)</h3>
<p>Selects text from position <i>start</i> and for <i>length</i> characters. Negative lengths are allowed.</p>
<p><b>See also </b><a href="qlineedit.html#deselect">deselect</a>(), <a href="qlineedit.html#selectAll">selectAll</a>(), and <a href="qlineedit.html#selectedText-prop">selectedText</a>().</p>
<!-- @@@setSelection -->
<!-- $$$setTextMargins[overload1]$$$setTextMarginsintintintint -->
<h3 class="fn" id="setTextMargins"><a name="setTextMargins"></a><span class="type">void</span> QLineEdit::<span class="name">setTextMargins</span>(<span class="type">int</span> <i>left</i>, <span class="type">int</span> <i>top</i>, <span class="type">int</span> <i>right</i>, <span class="type">int</span> <i>bottom</i>)</h3>
<p>Sets the margins around the text inside the frame to have the sizes <i>left</i>, <i>top</i>, <i>right</i>, and <i>bottom</i>.</p>
<p>See also <a href="qlineedit.html#getTextMargins">getTextMargins</a>().</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qlineedit.html#textMargins">textMargins</a>().</p>
<!-- @@@setTextMargins -->
<!-- $$$setTextMargins$$$setTextMarginsconstQMargins& -->
<h3 class="fn" id="setTextMargins-1"><a name="setTextMargins-1"></a><span class="type">void</span> QLineEdit::<span class="name">setTextMargins</span>(const <span class="type"><a href="../qtcore/qmargins.html">QMargins</a></span> &amp;<i>margins</i>)</h3>
<p>Sets the <i>margins</i> around the text inside the frame.</p>
<p>See also <a href="qlineedit.html#textMargins">textMargins</a>().</p>
<p>This function was introduced in  Qt 4.6.</p>
<!-- @@@setTextMargins -->
<!-- $$$setValidator[overload1]$$$setValidatorconstQValidator* -->
<h3 class="fn" id="setValidator"><a name="setValidator"></a><span class="type">void</span> QLineEdit::<span class="name">setValidator</span>(const <span class="type"><a href="../qtgui/qvalidator.html">QValidator</a></span> *<i>v</i>)</h3>
<p>Sets this line edit to only accept input that the validator, <i>v</i>, will accept. This allows you to place any arbitrary constraints on the text which may be entered.</p>
<p>If <i>v</i> == 0, setValidator() removes the current input validator. The initial setting is to have no input validator (i.e&#x2e; any input is accepted up to <a href="qlineedit.html#maxLength-prop">maxLength</a>()).</p>
<p><b>See also </b><a href="qlineedit.html#validator">validator</a>(), <a href="qlineedit.html#acceptableInput-prop">hasAcceptableInput</a>(), <a href="../qtgui/qintvalidator.html">QIntValidator</a>, <a href="../qtgui/qdoublevalidator.html">QDoubleValidator</a>, and <a href="../qtgui/qregexpvalidator.html">QRegExpValidator</a>.</p>
<!-- @@@setValidator -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QLineEdit::<span class="name">sizeHint</span>() const</h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<p>Returns a recommended size for the widget.</p>
<p>The width returned, in pixels, is usually enough for about 15 to 20 characters.</p>
<!-- @@@sizeHint -->
<!-- $$$textChanged -->
<h3 class="fn" id="textChanged"><a name="textChanged"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">textChanged</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>This signal is emitted whenever the text changes. The <i>text</i> argument is the new text.</p>
<p>Unlike <a href="qlineedit.html#textEdited">textEdited</a>(), this signal is also emitted when the text is changed programmatically, for example, by calling <a href="qlineedit.html#text-prop">setText</a>().</p>
<p><b>Note:</b> Notifier signal for property <a href="qlineedit.html#text-prop">text</a>. </p><!-- @@@textChanged -->
<!-- $$$textEdited[overload1]$$$textEditedconstQString& -->
<h3 class="fn" id="textEdited"><a name="textEdited"></a><code>[signal] </code><span class="type">void</span> QLineEdit::<span class="name">textEdited</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>)</h3>
<p>This signal is emitted whenever the text is edited. The <i>text</i> argument is the new text.</p>
<p>Unlike <a href="qlineedit.html#textChanged">textChanged</a>(), this signal is not emitted when the text is changed programmatically, for example, by calling <a href="qlineedit.html#text-prop">setText</a>().</p>
<!-- @@@textEdited -->
<!-- $$$textMargins[overload1]$$$textMargins -->
<h3 class="fn" id="textMargins"><a name="textMargins"></a><span class="type"><a href="../qtcore/qmargins.html">QMargins</a></span> QLineEdit::<span class="name">textMargins</span>() const</h3>
<p>Returns the widget's text margins.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qlineedit.html#setTextMargins">setTextMargins</a>().</p>
<!-- @@@textMargins -->
<!-- $$$undo[overload1]$$$undo -->
<h3 class="fn" id="undo"><a name="undo"></a><code>[slot] </code><span class="type">void</span> QLineEdit::<span class="name">undo</span>()</h3>
<p>Undoes the last operation if undo is <a href="qlineedit.html#undoAvailable-prop">available</a>. Deselects any current selection, and updates the selection start to the current cursor position.</p>
<!-- @@@undo -->
<!-- $$$validator[overload1]$$$validator -->
<h3 class="fn" id="validator"><a name="validator"></a>const <span class="type"><a href="../qtgui/qvalidator.html">QValidator</a></span> *QLineEdit::<span class="name">validator</span>() const</h3>
<p>Returns a pointer to the current input validator, or 0 if no validator has been set.</p>
<p><b>See also </b><a href="qlineedit.html#setValidator">setValidator</a>().</p>
<!-- @@@validator -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>