<?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[TextEdit and MouseArea]]></title><description><![CDATA[<p dir="auto">Hello, tell me please, how can I add a MouseArea to the TextEdit so that I can enter text, but if the course goes beyond the TextEdit element, I can process the onExited signal<br />
Flickable {</p>
<pre><code>  id: flick
  width: 300; height: 200;
  contentWidth: edit.paintedWidth
  contentHeight: edit.paintedHeight
  clip: true

  function ensureVisible(r)
  {
      if (contentX &gt;= r.x)
          contentX = r.x;
      else if (contentX+width &lt;= r.x+r.width)
          contentX = r.x+r.width-width;
      if (contentY &gt;= r.y)
          contentY = r.y;
      else if (contentY+height &lt;= r.y+r.height)
          contentY = r.y+r.height-height;
  }

  TextEdit {
      id: edit
      width: flick.width
      focus: true
      wrapMode: TextEdit.Wrap
      onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)

       MouseArea {
            id: mouseArea
            anchors.fill: parent
            hoverEnabled: true
            propagateComposedEvents: true
            onExited: {console.log("out mouse area")}
           }
  }
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.qt.io/topic/158021/textedit-and-mousearea</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 20:07:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/158021.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Aug 2024 14:30:16 GMT</pubDate><ttl>60</ttl></channel></rss>