<?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[reading textEdit when QEvent::KeyPress is called]]></title><description><![CDATA[<p dir="auto">Hi, I am trying to read the textedit text whenever a new entry is added. I use:</p>
<pre><code>    if(event-&gt;type() == QEvent::KeyPress ){
        QKeyEvent *kevent = static_cast&lt;QKeyEvent *&gt;(event);

         QString uu = ui-&gt;textEdit-&gt;toPlainText();
         qDebug() &lt;&lt; uu ;
        }
</code></pre>
<p dir="auto">uu does not include the latest key entry. seems the value of textEdit is not readily updated when this event occurs, and there is some sort of delay...</p>
]]></description><link>https://forum.qt.io/topic/139591/reading-textedit-when-qevent-keypress-is-called</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 02:50:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139591.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Sep 2022 23:58:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to reading textEdit when QEvent::KeyPress is called on Tue, 27 Sep 2022 01:16:25 GMT]]></title><description><![CDATA[<p dir="auto">The character corresponding to the key press (if there is one) may not be inserted in to the buffer until the key release event.</p>
<p dir="auto">Is the QTextEdit::textChanged() signal not a better solution to detecting change in the editor?</p>
]]></description><link>https://forum.qt.io/post/730275</link><guid isPermaLink="true">https://forum.qt.io/post/730275</guid><dc:creator><![CDATA[ChrisW67]]></dc:creator><pubDate>Tue, 27 Sep 2022 01:16:25 GMT</pubDate></item></channel></rss>