<?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[Qml Buttons and onClicked]]></title><description><![CDATA[<p dir="auto">Right now I have Qml code sending a signal to my c++ code that sends a true or false. When the button is clicked it sends a signal containing true. This is working how I want it to but I would like to send a false signal when the button is let go.</p>
<p dir="auto">So basically I am asking how you would send a true signal when the button is held down by the user and then send a false signal when the user lets go.</p>
<p dir="auto">I have looked into using states but I haven't found much information about them.</p>
<p dir="auto">Thanks for any help that can be offered. Below is my qml code.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/import">@<bdi>import</bdi></a> QtQuick 2.0<br />
import QtQuick.Window 2.0<br />
import QtQuick.Controls 1.0<br />
import QtQuick.Layouts 1.0<br />
import QtQuick.Dialogs 1.0<br />
import QtQuick.Particles 2.0</p>
<p dir="auto">Item {<br />
id: item<br />
width: 300; height: 300</p>
<pre><code>signal qmlSignal(bool msg)

Rectangle {
    id: rectangle1
    x: 0
    y: 0
    width: 300
    height: 300
    color: "#c02323"

    Button {
        id: button1
        x: 0
        y: 0
        width: 300
        height: 300
        text: "button"
        onClicked: item.qmlSignal(true)
    }
    
}
</code></pre>
<p dir="auto">}<br />
@</p>
]]></description><link>https://forum.qt.io/topic/36822/qml-buttons-and-onclicked</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 19:39:00 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/36822.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Jan 2014 20:40:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qml Buttons and onClicked on Tue, 21 Jan 2014 20:40:38 GMT]]></title><description><![CDATA[<p dir="auto">I just made it a mouse area and used onPressed and onReleased</p>
]]></description><link>https://forum.qt.io/post/211710</link><guid isPermaLink="true">https://forum.qt.io/post/211710</guid><dc:creator><![CDATA[koolbi]]></dc:creator><pubDate>Tue, 21 Jan 2014 20:40:38 GMT</pubDate></item><item><title><![CDATA[Reply to Qml Buttons and onClicked on Mon, 20 Jan 2014 21:32:50 GMT]]></title><description><![CDATA[<p dir="auto">You can use the signal handler</p>
<p dir="auto">@onPressedChanged@</p>
]]></description><link>https://forum.qt.io/post/211548</link><guid isPermaLink="true">https://forum.qt.io/post/211548</guid><dc:creator><![CDATA[t3685]]></dc:creator><pubDate>Mon, 20 Jan 2014 21:32:50 GMT</pubDate></item></channel></rss>