<?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[TextField still allows user input &quot;0&quot; with validator: IntValidator {bottom: 1; top: 100;}]]></title><description><![CDATA[<p dir="auto">It will not pass this value to backend.<br />
How to forbid input "0" with a popup hint string?<br />
Thanks~</p>
]]></description><link>https://forum.qt.io/topic/84716/textfield-still-allows-user-input-0-with-validator-intvalidator-bottom-1-top-100</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 13:33:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/84716.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Nov 2017 00:53:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TextField still allows user input &quot;0&quot; with validator: IntValidator {bottom: 1; top: 100;} on Thu, 16 Nov 2017 08:20:48 GMT]]></title><description><![CDATA[<p dir="auto">hi,</p>
<p dir="auto">TextField{<br />
validator: RegExpValidator { regExp: /^[1-9][0-9]*$/ }<br />
}</p>
]]></description><link>https://forum.qt.io/post/426347</link><guid isPermaLink="true">https://forum.qt.io/post/426347</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Thu, 16 Nov 2017 08:20:48 GMT</pubDate></item><item><title><![CDATA[Reply to TextField still allows user input &quot;0&quot; with validator: IntValidator {bottom: 1; top: 100;} on Thu, 16 Nov 2017 01:07:35 GMT]]></title><description><![CDATA[<p dir="auto">Thank you!<br />
When input is invalid, it keeps silent.<br />
So I finally do a trick by forcing no "0" from the begin (The input needs to be integers start from 1).<br />
onTextChanged: {<br />
if(text.substring(0, 1) == "0")<br />
text = "1"<br />
}</p>
]]></description><link>https://forum.qt.io/post/426279</link><guid isPermaLink="true">https://forum.qt.io/post/426279</guid><dc:creator><![CDATA[llllyxzy]]></dc:creator><pubDate>Thu, 16 Nov 2017 01:07:35 GMT</pubDate></item><item><title><![CDATA[Reply to TextField still allows user input &quot;0&quot; with validator: IntValidator {bottom: 1; top: 100;} on Fri, 03 Nov 2017 01:32:22 GMT]]></title><description><![CDATA[<p dir="auto">Have tried with accepted() signal  ? This will emit only if the input is valid. You can show pop-up inside the accepted signal handler.</p>
]]></description><link>https://forum.qt.io/post/424065</link><guid isPermaLink="true">https://forum.qt.io/post/424065</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Fri, 03 Nov 2017 01:32:22 GMT</pubDate></item></channel></rss>