<?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[How to prevent using key sequences in TextArea]]></title><description><![CDATA[<p dir="auto">Hello, everyone! Now, I'd like to prevent users from using Ctrl+Z in TextArea and I'm doing like this:<br />
TextArea{<br />
Keys.onPressed: {<br />
if(event.matches(StandardKey.Undo)){<br />
event.accepted = false<br />
console.log("prevent undo:")<br />
}<br />
}<br />
}<br />
Although I've received "prevent undo" in the console, the key sequences still works. Does anyone know the answer ? Thanks in advance.</p>
]]></description><link>https://forum.qt.io/topic/126499/how-to-prevent-using-key-sequences-in-textarea</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 01:23:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126499.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 May 2021 02:50:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to prevent using key sequences in TextArea on Mon, 10 May 2021 05:50:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alexchris">@<bdi>AlexChris</bdi></a> said in <a href="/post/658849">How to prevent using key sequences in TextArea</a>:</p>
<blockquote>
<p dir="auto">event.accepted = false</p>
</blockquote>
<p dir="auto">Shouldn't you set it to true to signal that you want to process it on your own without propagating it further?</p>
]]></description><link>https://forum.qt.io/post/658862</link><guid isPermaLink="true">https://forum.qt.io/post/658862</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Mon, 10 May 2021 05:50:15 GMT</pubDate></item></channel></rss>