<?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[Sending data from one QML to Another when click on checkbox]]></title><description><![CDATA[<p dir="auto">hey there I am developing an application, in that i need to send checkbox checked status from mail.qml to graph.qml  on each click (check and uncheck)</p>
<p dir="auto">my mail.qml is</p>
<p dir="auto">import QtQuick 2.7<br />
import QtQuick.Window 2.2<br />
import QtQuick.Controls 1.2</p>
<p dir="auto">Window {<br />
visible: true<br />
width: 640<br />
height: 480<br />
title: qsTr("Hello World")</p>
<pre><code>Rectangle
{
    id: connectButton
    x: 130
    y: 10
    width: 70
    height: 30
    visible: true
    gradient: Gradient
    {
        GradientStop
        {
            position: 0
            color: "#ffffff"
        }

        GradientStop
        {
            position: 1
            color: "#000000"
        }
    }
    border.color: "#251f1f"

    Text
    {
        id: text1
        text: qsTr("Connect")
        verticalAlignment: Text.AlignVCenter
        horizontalAlignment: Text.AlignHCenter
        transformOrigin: Item.Center
        anchors.fill: parent
        font.pixelSize: 12
    }
    MouseArea
    {
        anchors.fill: parent

        onClicked:
        {
            console.log(qsTr("Connect Button Clicked"))// + textEdit.text + '"'))
           loader.source = "Graph.qml"

            //To-do

            //Connection with aurdino will come here
           /* viewButton.visible = true
            sensorButton.visible = true
            sensorOption.visible = true
            viewOption.visible = true*/


        }


    }

}


Rectangle {
    id: graphView
    x: 0
    y: 200
    width: 630
    height: 443
   gradient: Gradient {
        GradientStop {
            position: 0
            color: "#ffffff"
        }

        GradientStop {
            position: 1
            color: "#000000"
        }
    }


    Loader
    {
        id: loader
        anchors.bottomMargin: 0
        anchors.leftMargin: 0
        anchors.topMargin: 0
        anchors.rightMargin: 0
        anchors.fill: parent
    }
}



Column {
    id:sensorOption
    x:450
    y:80
    visible: true


    CheckBox {
        text: qsTr("Temperature")
        checked: true
        onClicked:
            if(checked == true)
            {
                 console.log(qsTr("Temperature Sensor selected")+test)

            }
        else
            {
                 console.log(qsTr("Temperature Sensor unselected"))
            }


    }
    CheckBox {
        text: qsTr("Torque")
        onClicked:
            if(checked == true)
            {
                 console.log(qsTr("Torque Sensor selected"))
            }
        else
            {
                 console.log(qsTr("Torque Sensor Unselected"))
            }
    }
    CheckBox
    {
        text: qsTr("Accelerometer")
        onClicked:
            if(checked == true)
            {
                 console.log(qsTr("Accelerometer Sensor selected"))
            }
        else
            {
                 console.log(qsTr("Accelerometer Sensor unselected"))
            }
   }
}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">my graph.qml is</p>
<p dir="auto">import QtQuick 2.0<br />
import QtCharts 2.0</p>
<p dir="auto">Item {<br />
id: graph<br />
anchors.fill: parent</p>
<pre><code>ChartView {
    id:chartName
    title: "Sensor"
    anchors.fill: parent
    antialiasing: true

    LineSeries {
        id:temperature
        name: "Here name will come from mail.qml"
        XYPoint { x: 0; y: 0 }
        XYPoint { x: 1.1; y: 2.1 }
        XYPoint { x: 1.9; y: 3.3 }
        XYPoint { x: 2.1; y: 2.1 }
        XYPoint { x: 2.9; y: 4.9 }
        XYPoint { x: 3.4; y: 3.0 }
        XYPoint { x: 4.1; y: 3.3 }


    }

}
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.qt.io/topic/75904/sending-data-from-one-qml-to-another-when-click-on-checkbox</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 09:15:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/75904.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Feb 2017 06:17:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sending data from one QML to Another when click on checkbox on Tue, 07 Feb 2017 07:13:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dheerendra">@<bdi>dheerendra</bdi></a> said in <a href="/post/374011">Sending data from one QML to Another when click on checkbox</a>:</p>
<blockquote>
<p dir="auto">calling function in another qml object</p>
</blockquote>
<p dir="auto">it worked for me<br />
<a href="https://forum.qt.io/topic/46052/use-a-function-in-qml-from-another-qml/4">https://forum.qt.io/topic/46052/use-a-function-in-qml-from-another-qml/4</a></p>
]]></description><link>https://forum.qt.io/post/374020</link><guid isPermaLink="true">https://forum.qt.io/post/374020</guid><dc:creator><![CDATA[Raghvendra]]></dc:creator><pubDate>Tue, 07 Feb 2017 07:13:49 GMT</pubDate></item><item><title><![CDATA[Reply to Sending data from one QML to Another when click on checkbox on Tue, 07 Feb 2017 07:05:55 GMT]]></title><description><![CDATA[<p dir="auto">You can move this issue to SOLVED state.</p>
]]></description><link>https://forum.qt.io/post/374017</link><guid isPermaLink="true">https://forum.qt.io/post/374017</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Tue, 07 Feb 2017 07:05:55 GMT</pubDate></item><item><title><![CDATA[Reply to Sending data from one QML to Another when click on checkbox on Tue, 07 Feb 2017 06:39:24 GMT]]></title><description><![CDATA[<p dir="auto">Define the function called</p>
<ol>
<li>callRaghavendra(value) in Graph.qml</li>
<li>When you click on the checkbox , inside the signal handler call with<br />
loader.item.callRaghavendra(&lt;value you would like to pass&gt;)</li>
</ol>
<p dir="auto">Also look for signal/slot communication in QML and function in QML. It will help you.</p>
]]></description><link>https://forum.qt.io/post/374013</link><guid isPermaLink="true">https://forum.qt.io/post/374013</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Tue, 07 Feb 2017 06:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Sending data from one QML to Another when click on checkbox on Tue, 07 Feb 2017 06:24:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dheerendra">@<bdi>dheerendra</bdi></a> I just loaded graph.qml using loader, I am very new in qt.</p>
<p dir="auto">onClicked:<br />
{<br />
console.log(qsTr("Connect Button Clicked"))// + textEdit.text + '"'))<br />
loader.source = "Graph.qml"</p>
<p dir="auto">line no 49 to 52</p>
]]></description><link>https://forum.qt.io/post/374012</link><guid isPermaLink="true">https://forum.qt.io/post/374012</guid><dc:creator><![CDATA[Raghvendra]]></dc:creator><pubDate>Tue, 07 Feb 2017 06:24:46 GMT</pubDate></item><item><title><![CDATA[Reply to Sending data from one QML to Another when click on checkbox on Tue, 07 Feb 2017 06:22:29 GMT]]></title><description><![CDATA[<p dir="auto">There is nothing like sending data from one QML to another QML. You need to send the data from one object to another object. Where are you creating the object of Graph.qml ? I did not see any creation of Graph.qml in your main.qml.</p>
<p dir="auto">You can pass the data to other object either by signal/slots or calling function in another qml object</p>
]]></description><link>https://forum.qt.io/post/374011</link><guid isPermaLink="true">https://forum.qt.io/post/374011</guid><dc:creator><![CDATA[dheerendra]]></dc:creator><pubDate>Tue, 07 Feb 2017 06:22:29 GMT</pubDate></item></channel></rss>