<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Constraining user input to a QLineEdit]]></title><description><![CDATA[<p dir="auto">I need to force the user of a QLineEdit widget to input a string that represent a float between "20.00" and "99.99".  I'm using a QDoubleValidator (QDoubleValidator(20, 99.99, 2, this ) at present, but the results are not perfect.  What I really want is to <em>force</em> the decimal to appear in the editor as soon as the second digit is entered by the user (keypad does not allow non-numeric chars other than the period in this state). Would a Completer work?  I looked at that and it seems possible but <em>way</em> complicated.  That makes me think there might be a simpler way that my neophyte QT brain is missing ...</p>
<p dir="auto">Any direction/help would really be appreciated.</p>
]]></description><link>https://forum.qt.io/topic/163264/constraining-user-input-to-a-qlineedit</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 01:49:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163264.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Sep 2025 18:30:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 20:08:12 GMT]]></title><description><![CDATA[<p dir="auto">More good points <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> .  I did not know about know about <a href="https://doc.qt.io/qt-6/qobject.html#blockSignals" target="_blank" rel="noopener noreferrer nofollow ugc">QObject::blockSignals(bool block)</a>.  A flag would certainly work too which is what my original 'inFlight' idea started out as.  I'm gonna play with it some more ... needs some additional refactoring anyway.</p>
<p dir="auto">Thx again!</p>
<p dir="auto">Edit: I shied away from setText() because it doesn't re-validate the text.  I don't look at <a href="https://doc.qt.io/archives/qt-5.15/qlineedit.html#acceptableInput-prop" target="_blank" rel="noopener noreferrer nofollow ugc">acceptableInput</a> until after the user presses ENTER ... not sure if that event re-runs the validation and maybe it's not an issue anyway.</p>
]]></description><link>https://forum.qt.io/post/831812</link><guid isPermaLink="true">https://forum.qt.io/post/831812</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Fri, 19 Sep 2025 20:08:12 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 17:48:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a><br />
By "outside world" (for <code>findChild&lt;&gt;()</code>) I mean anywhere other than the <code>.cpp</code> where it is defined.  It is preferable if that exports it if intended, otherwise you are delving into somewhere else's internal details.  Not a 100% rule, just preferable not to.</p>
<p dir="auto">You choose to <code>disconnect()</code> and then re-<code>connect()</code>.  For my own part I would prefer not to make a change like that, similarly for <a href="https://doc.qt.io/qt-6/qobject.html#blockSignals" target="_blank" rel="noopener noreferrer nofollow ugc">QObject::blockSignals(bool block)</a> which you will see others would use here (actually it's not too bad in this case, the scope is pretty clear and limited).  You can if you wish, but (say those didn't exist) why not use a simple flag (<code>static</code> in the method or as a class member variable) which you set on entry and clear on exit, simply <code>return</code> if you re-enter while it is set?</p>
<p dir="auto">Or use <code>setText()</code> only in the first place :)</p>
<p dir="auto">Anyway you are good, there are many ways to skin a cat....</p>
]]></description><link>https://forum.qt.io/post/831810</link><guid isPermaLink="true">https://forum.qt.io/post/831810</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 19 Sep 2025 17:48:32 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 15:29:34 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> . I will read the documentation more carefully.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/831804">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">If you want to work from Designer, it will save a .ui file and your build process will run uic on that to generate a ui_....h file containing C++ code implementing what you have designed. And the will be #included into a class_name.cpp file you compile.</p>
</blockquote>
<p dir="auto">Ok so there is an additional, pre-compiler compiler other than the moc right?  So the <strong>uic</strong> translates the xml from the <em>.ui files into the ui_</em>.h headers, then the <strong>moc</strong> runs though all the code in the rest of the source and does it's thing, then that all gets fed to the compiler proper.  Or some variant thereof?  Cool.</p>
<blockquote>
<p dir="auto">Usually it's better not to findChild&lt;&gt;() from the outside world.</p>
</blockquote>
<p dir="auto">So not kosher to call this from a descendant of QDialog for example?  That is what you mean by outside world?</p>
<p dir="auto">Thx again for the help <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> et. al.  The Qt community is very helpful and friendly!</p>
<p dir="auto">BTW: This worked much better after I thought about what you said earlier:</p>
<pre><code>void fltsetter::hdlTextEdited(const QString &amp;text)
{
    int currentCursorPos;
    
    qInfo() &lt;&lt; "fltsetter::hdlTextEdited(" &lt;&lt; text &lt;&lt; ")";
    qInfo() &lt;&lt; "Current cursor pos: " &lt;&lt; (currentCursorPos = editor-&gt;cursorPosition());
    qInfo() &lt;&lt; "Last cursor pos: " &lt;&lt; lastCursorPos;
    qInfo() &lt;&lt; "size: " &lt;&lt; editor-&gt;text().size();

    disconnect(editor, &amp;QLineEdit::textEdited, this, &amp;fltsetter::hdlTextEdited);

    // 1. If adding char at position 2, insert decimal
    if ((currentCursorPos == 2) &amp;&amp; (lastCursorPos == 1))
    {
        qInfo() &lt;&lt; "Inserting decimal";
        editor-&gt;insert(".");
        qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
    }

    // 2. If adding third char after decimal erased, insert a decimal in pos 3
    else if ((currentCursorPos == 3) &amp;&amp; (lastCursorPos == 2) &amp;&amp; (text.back() != "."))
    {
        qInfo() &lt;&lt; "Substituting decimal";
        auto lastChar = text.back();
        editor-&gt;backspace();
        editor-&gt;insert(".");
        qInfo() &lt;&lt; "Last char: " &lt;&lt; lastChar;
        editor-&gt;insert(lastChar);
        qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
    }

    connect(editor, &amp;QLineEdit::textEdited, this, &amp;fltsetter::hdlTextEdited);

    qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
}

</code></pre>
]]></description><link>https://forum.qt.io/post/831806</link><guid isPermaLink="true">https://forum.qt.io/post/831806</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Fri, 19 Sep 2025 15:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 14:42:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a> said in <a href="/post/831802">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">Good catch on the documentation thing. From the 5.15 documentation:</p>
<p dir="auto">Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by calling setText().</p>
</blockquote>
<p dir="auto">As I wrote, that is against the <code>textEdited()</code> signal entry.  Even in 5.15 go to the <a href="https://doc.qt.io/archives/qt-5.15/qlineedit.html#details" target="_blank" rel="noopener noreferrer nofollow ugc">Description</a> paragraphs and look for</p>
<blockquote>
<p dir="auto">When the text changes the textChanged() signal is emitted; when the text changes other than by calling setText() the textEdited() signal is emitted;</p>
</blockquote>
<p dir="auto">It's worth reading the <strong>Description</strong> section in each page.</p>
<p dir="auto">If you want to work from <strong>Designer</strong>, it will save a <code>.ui</code> file and your <em>build</em> process will run <code>uic</code> on that to generate a <code>ui_....h</code> file containing C++ code implementing what you have designed.  And the will be <code>#include</code>d into a <code>class_name.cpp</code> file you compile.</p>
<p dir="auto">Usually it's better not to <code>findChild&lt;&gt;()</code> from the outside world.  The <code>.cpp</code> can either (a) implement the behaviour or (b) export the <code>QLineEdit</code> or similar for access from elsewhere as a dedicated C++ method.  If you intend to do any designing yourself you will want to look at this.</p>
<p dir="auto">You can subclass widgets you use from <strong>Designer</strong> if you wish.  It does require an extra "step",   This is called <a href="https://doc.qt.io/qt-6/designer-using-custom-widgets.html#promoting-widgets" target="_blank" rel="noopener noreferrer nofollow ugc">Promotion</a>.</p>
]]></description><link>https://forum.qt.io/post/831804</link><guid isPermaLink="true">https://forum.qt.io/post/831804</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Fri, 19 Sep 2025 14:42:48 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 14:28:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a></p>
<p dir="auto">Yeah I hear ya, it is an old pattern and I did try the input mask but it I couldn't get it to work.  I set the mask in QtDesigner like this:</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/2bee0f65-fd10-4fd0-bbdb-82701f8c7107.png" alt="bfbf3e43-4571-463b-97f4-b3043db1975b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">But the inputMask is really just another form of validation right?  It doesn't modify the behavior of the editor itself.  That is, it doesn't <em>force</em> the user to type 4 digits separated by a period, it just invalidates the entry (hasAcceptableInput() returns <em>false</em>).</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a> said in <a href="/post/831748">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">Use QLineEdit's input mask functionality to make the decimal point a fixture the user can't delete.</p>
</blockquote>
<p dir="auto">Best I can tell, it won't prevent the decimal from being backspaced over ... though you can't set the <strong>text</strong> attribute to anything  <em><strong>but</strong></em> a period in Designer.  In the running program however, with the editor focused, the user can backspace right over it and type anything they want.  Could it be because I also have a validator set?:</p>
<pre><code>editor-&gt;setValidator(new QDoubleValidator(20, 99.99, 2, this ));
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a> said in <a href="/post/831748">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">Actually use two line edits, each with a validator allowing two digits, the first line edit automatically moving focus to the second one once full. The decimal point can then be just a label between the line edits.</p>
</blockquote>
<p dir="auto">Yeah this idea certainly occurred to me and seems perfectly valid.  Part of this project though, is a learning exercise for me and I wanted to explore QLineEdit as thoroughly as possible.  I do appreciate the help and information <a class="plugin-mentions-user plugin-mentions-a" href="/user/igkh">@<bdi>IgKh</bdi></a></p>
]]></description><link>https://forum.qt.io/post/831803</link><guid isPermaLink="true">https://forum.qt.io/post/831803</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Fri, 19 Sep 2025 14:28:38 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Fri, 19 Sep 2025 14:01:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a></p>
<p dir="auto">Good catch on the documentation thing.  From the 5.15 documentation:</p>
<blockquote>
<p dir="auto">Unlike textChanged(), this signal is not emitted when the text is changed programmatically, <strong>for example</strong>, by calling setText().</p>
</blockquote>
<p dir="auto">Yeah I can refactor and use setText().  Seems a better solution.</p>
<p dir="auto">The definition of 'editor' I included here was in fact for clarity only.  Actually the class is declared with a private member 'QLineEdit* editor' and then when I need the editor, I use findChild.  The actual instantiation of the object is done in ui_fltsetter.h which I intuit to be created by some tool in the chain from the xml code generated by QtDesigner?? (from fltsetter.ui???).  Honestly, I have only the vaguest understanding of how that process works, but the only way I know to get a handle to the instance is with findChild.  Unless of course I created and configured the object problematically I guess, but doesn't that defeat the purpose of using the Designer?  Could you suggest a better solution?  I'm very interested in learning because I really like Qt.  It was recommended to me years ago, but I ignored the advice as in my 40 year career up until now, I never needed a graphical UI.  It's all been little machines gathering data and talking to each other.  Qt is more than a UI though, I am happy to be discovering and even as my career winds down, I still love discovering new things.</p>
<p dir="auto">Anyway, I do take your point though about creating a scion of QLineEdit.  My initial foray into subclassing QtObjects was unsuccessful and due to schedule at that moment (running with scissors, dowsed in gasoline, pursued by stackholders carrying torches and pitchforks) I had to move on with best effort.  In the original proto, forcing the user to engage their brain to enter a mixed number with the editing capabilities of the stock QLineEdit seemed acceptable.</p>
]]></description><link>https://forum.qt.io/post/831802</link><guid isPermaLink="true">https://forum.qt.io/post/831802</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Fri, 19 Sep 2025 14:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 17:34:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a><br />
If it works, fine!  If I remember I will have a look tomorrow to see how <code>textEdited()</code> behaves under Qt6.  The docs are pretty vague about what "whenever the text is edited" means.  Oh, look at this at the top of the doc page <a href="https://doc.qt.io/qt-6/qlineedit.html#editing-text" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qlineedit.html#editing-text</a></p>
<blockquote>
<p dir="auto">When the text changes, the textChanged() signal is emitted. When the text changes in some other way than by calling setText(), the textEdited() signal is emitted.</p>
</blockquote>
<p dir="auto">So actually there is your answer, though I didn't know it.</p>
<p dir="auto">As I said earlier, ISTM you could have written your code to use <code>setText()</code> where you use <code>insert()</code>/<code>backspace()</code>.  (And aren't your calls in <code>hdlTextEdited()</code> causing it to be called again from itself?)</p>
<p dir="auto">On a separate matter, it's up to you but this kind thing</p>
<blockquote>
<p dir="auto">QLineEdit* editor  = this-&gt;findChild&lt;QLineEdit*&gt;("filterEdit");   // Private Member of fltsetter</p>
</blockquote>
<p dir="auto">is ugly.  Did you consider creating a subclass of <code>QLineEdit</code> for your behaviour and using that for the line edit where appropriate?</p>
]]></description><link>https://forum.qt.io/post/831752</link><guid isPermaLink="true">https://forum.qt.io/post/831752</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 18 Sep 2025 17:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 16:29:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a> said in <a href="/post/831737">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">I simply want to force the user to enter a string representation of a positive, floating-point value &lt; 99.99 like this: "XX.YY" without forcing them to type the decimal point.</p>
</blockquote>
<p dir="auto">That's not a super unusual thing to do. Reminds me of when installers had screen to enter serial numbers, and you could type them without the hyphens.</p>
<p dir="auto">Two alternative approaches to possibly consider:</p>
<ul>
<li>
<p dir="auto">Use QLineEdit's input mask functionality to make the decimal point a fixture the user can't delete.</p>
</li>
<li>
<p dir="auto">Actually use two line edits, each with a validator allowing two digits, the first line edit automatically moving focus to the second one once full. The decimal point can then be just a label between the line edits.</p>
</li>
</ul>
]]></description><link>https://forum.qt.io/post/831748</link><guid isPermaLink="true">https://forum.qt.io/post/831748</guid><dc:creator><![CDATA[IgKh]]></dc:creator><pubDate>Thu, 18 Sep 2025 16:29:04 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 15:33:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> it is definitely happening.  I fixed it with a simple in-flight mechanism in the signal handler:</p>
<pre><code>QLineEdit* editor  = this-&gt;findChild&lt;QLineEdit*&gt;("filterEdit");   // Private Member of fltsetter
connect(editor, &amp;QLineEdit::textEdited, this, &amp;fltsetter::hdlTextEdited);

...

void fltsetter::hdlTextEdited(const QString &amp;text)
{
    int currentCursorPos;
    static int inFlight = 0;

    qInfo() &lt;&lt; "fltsetter::hdlTextEdited(" &lt;&lt; text &lt;&lt; ")";
    qInfo() &lt;&lt; "Current cursor pos: " &lt;&lt; (currentCursorPos = editor-&gt;cursorPosition());
    qInfo() &lt;&lt; "Last cursor pos: " &lt;&lt; lastCursorPos;
    qInfo() &lt;&lt; "size: " &lt;&lt; editor-&gt;text().size();
    qInfo() &lt;&lt; "InFlight: " &lt;&lt; inFlight;

    if (inFlight--)
    {
        qInfo() &lt;&lt; "Inflight!";
        return;
    }

    // 1. Limit the size to 5
    if (editor-&gt;text().size() &gt; 5)
    {
        inFlight++;

        editor-&gt;backspace();
        qInfo() &lt;&lt; "Size limited to 5 chars";
        qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
        return;
    }

    // 2. If adding char at position 2, insert decimal
    if ((currentCursorPos == 2) &amp;&amp; (lastCursorPos == 1))
    {
        inFlight++;

        editor-&gt;insert(".");
        qInfo() &lt;&lt; "Inserting decimal";
        qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
        return;
    }

    // 3. If adding third char after decimal erased, insert a decimal in pos 3
    if ((currentCursorPos == 3) &amp;&amp; (lastCursorPos == 2) &amp;&amp; (text.at(currentCursorPos) != "."))
    {
        inFlight += 3;

        QChar lastChar = text.at(currentCursorPos);
        editor-&gt;backspace();
        editor-&gt;insert(".");
        editor-&gt;insert(lastChar);
        qInfo() &lt;&lt; "Substituting decimal";
        qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
        return;
    }

    inFlight = 0;

    qInfo() &lt;&lt; "New cursor pos: " &lt;&lt; (lastCursorPos = editor-&gt;cursorPosition());
}
</code></pre>
<p dir="auto">The logs (which I can now pare-down some) verified that the signal handler was re-entering as a result of the insert() and backspace() methods being called and the inFlight mechanism fixed it right up.  Behaves exactly as I would have expected (without the inflight) if the insert() and backspace() methods <em>didn't</em> generate the signal.</p>
<p dir="auto">Anyway it works now.  It's a clumsy, non-generic solution, but pays the bills in this case looks like.</p>
]]></description><link>https://forum.qt.io/post/831746</link><guid isPermaLink="true">https://forum.qt.io/post/831746</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Thu, 18 Sep 2025 15:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 14:27:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a><br />
I would not have expected <code>textEdited()</code> to be emitted against a programmatic <code>insert()</code>.</p>
<p dir="auto">If that is <em>really</em>, <em>really</em> happening you might be able to work around it with one of:</p>
<ul>
<li>
<p dir="auto">Where you do an <code>insert()</code> in code, instead get the whole text as a string, insert your character/<code>.</code> into that, and use <code>setText()</code> to put the whole string back.</p>
</li>
<li>
<p dir="auto">Set a flag in code prior to your <code>insert()</code>, check the flag in your slot on <code>textEdited()</code> and ignore, clear the flag afterwards.</p>
</li>
</ul>
]]></description><link>https://forum.qt.io/post/831742</link><guid isPermaLink="true">https://forum.qt.io/post/831742</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 18 Sep 2025 14:27:00 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 13:56:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kent-dorfman">@<bdi>Kent-Dorfman</bdi></a> I simply want to force the user to enter a string representation of a positive, floating-point value &lt; 99.99 like this: "XX.YY" without forcing them to type the decimal point.  Sounds silly but that is what the customer demands (or strongly desires anyway).  Why? Because the previous version of the product (designed 15 years ago) does it that way.</p>
<p dir="auto">I got pretty close yesterday by using QLineEdit::textEdited() and selectively inserting the decimal based on current and previous cursor positions.  However, for some reason that isn't clear to me, QLineEdit::textEdited() is signaled in response to QLineEdit::insert().  That causes all manner of havoc in the case that the user backspaces over the decimal and then inserts a new numeral.</p>
<p dir="auto">From the documentation I don't think that should happen right??? I would think QLineEdit::insert() would qualify as a programmatic change to the text and should only result in QLineEdit::textChanged() being signalled. QLineEdit::textEdited() <em>should not</em> be generated in that case correct??</p>
<p dir="auto">The framework is 5.15LTS (which I realize went EOL back in the spring) ... could it just be a bug in QLineEdit of that vintage?</p>
]]></description><link>https://forum.qt.io/post/831737</link><guid isPermaLink="true">https://forum.qt.io/post/831737</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Thu, 18 Sep 2025 13:56:04 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 06:30:34 GMT]]></title><description><![CDATA[<p dir="auto">Seems like to get the level of control the op wants they will need to design a custom widget.  (maybe) sublcassing the validator and completer can accomplish their need, but I suspect they want finer grained control of the data entry.</p>
]]></description><link>https://forum.qt.io/post/831718</link><guid isPermaLink="true">https://forum.qt.io/post/831718</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Thu, 18 Sep 2025 06:30:34 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Thu, 18 Sep 2025 04:20:06 GMT]]></title><description><![CDATA[<p dir="auto">I don't fully understand your need but about SpinBox...</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dallas-posey">@<bdi>Dallas-Posey</bdi></a> said in <a href="/post/831698">Constraining user input to a QLineEdit</a>:</p>
<blockquote>
<p dir="auto">Is there a way to hide the step decorator and disable stepping?</p>
</blockquote>
<p dir="auto">Yes! Just call <code>setButtonSymbols(QAbstractSpinBox::NoButtons)</code>.<br />
If you also want to disable stepping by up/down key, use <code>setSingleStep(0)</code>.</p>
]]></description><link>https://forum.qt.io/post/831711</link><guid isPermaLink="true">https://forum.qt.io/post/831711</guid><dc:creator><![CDATA[Bonnie]]></dc:creator><pubDate>Thu, 18 Sep 2025 04:20:06 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Wed, 17 Sep 2025 20:36:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> I do use SpinBoxes else where in the ui ...  maybe???  Is there a way to hide the step decorator and disable stepping?  My ui has no pointer device (or touch interface) at all and a fairly limited keypad.</p>
]]></description><link>https://forum.qt.io/post/831698</link><guid isPermaLink="true">https://forum.qt.io/post/831698</guid><dc:creator><![CDATA[Dallas Posey]]></dc:creator><pubDate>Wed, 17 Sep 2025 20:36:35 GMT</pubDate></item><item><title><![CDATA[Reply to Constraining user input to a QLineEdit on Wed, 17 Sep 2025 18:35:52 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">What about <a href="https://doc.qt.io/qt-6/qdoublespinbox.html" target="_blank" rel="noopener noreferrer nofollow ugc">QDoubleSpinBox</a> ?</p>
]]></description><link>https://forum.qt.io/post/831696</link><guid isPermaLink="true">https://forum.qt.io/post/831696</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 17 Sep 2025 18:35:52 GMT</pubDate></item></channel></rss>