<?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[Styling a checkbox]]></title><description><![CDATA[<p dir="auto">Hi<br />
I want to style a checkbox so it just displays a border, so I followed the example in the documentation</p>
<pre><code>//           CheckBox {
                id: checkBox
                anchors.verticalCenter: parent.verticalCenter
                visible: model.checkbox
                style: CheckBoxStyle {
                    indicator: Rectangle {
                        implicitHeight: 16
                        implicitWidth: 16
                        border.color: "red"
                        color: "transparent"
                        Rectangle {
                            visible: control.checked
                            color: "#555"
                            border.color: "#333"
                            radius: 1
                            anchors.margins: 4
                            anchors.fill: parent
                        }
                    }

                }
            }
</code></pre>
<p dir="auto">This does give me a checkbox with a border, however the indicator is now a rectangle within the checkbox, because of the second rectangle definition. Without this definition I cannot 'check' the box, but my requirement is to show a 'tick' when checked (default without styling)<br />
So I do I style my check box but retain the tick for checked boxes?<br />
Thanks</p>
]]></description><link>https://forum.qt.io/topic/101605/styling-a-checkbox</link><generator>RSS for Node</generator><lastBuildDate>Sun, 03 May 2026 00:32:34 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/101605.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Apr 2019 15:16:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Styling a checkbox on Wed, 10 Apr 2019 07:53:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gojir4">@<bdi>Gojir4</bdi></a><br />
I also need to provide an image for the indicator</p>
<pre><code>            CheckBox {
                id: checkBox
                checked: true
                anchors.verticalCenter: parent.verticalCenter
                visible: model.checkbox
                style: CheckBoxStyle {
                    indicator: Rectangle {
                        implicitHeight: 16
                        implicitWidth: 16
                        border.color: "#22add8"
                        color: "transparent"
                        Image {
                            x: (parent.width - width) / 2
                            y: (parent.height - height) / 2
                            source: "images/tick.png"
                            visible: checkBox.checked
                        }
                    }

                }
</code></pre>
]]></description><link>https://forum.qt.io/post/522253</link><guid isPermaLink="true">https://forum.qt.io/post/522253</guid><dc:creator><![CDATA[GrahamLa]]></dc:creator><pubDate>Wed, 10 Apr 2019 07:53:05 GMT</pubDate></item><item><title><![CDATA[Reply to Styling a checkbox on Tue, 09 Apr 2019 16:10:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/grahamla">@<bdi>GrahamLa</bdi></a> Hi,</p>
<p dir="auto">According to <a href="https://doc.qt.io/qt-5.9/qtquickcontrols2-customize.html#customizing-checkbox" target="_blank" rel="noopener noreferrer nofollow ugc">Customizing CheckBox</a>.</p>
<p dir="auto">I guess you only need to define <code>background</code> in your style and put then your rectangle with border inside.</p>
<pre><code>style: CheckBoxStyle {
    background: Rectangle {
        implicitHeight: 16
        implicitWidth: 16
        border.color: "red"
        color: "transparent"
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/522139</link><guid isPermaLink="true">https://forum.qt.io/post/522139</guid><dc:creator><![CDATA[Gojir4]]></dc:creator><pubDate>Tue, 09 Apr 2019 16:10:35 GMT</pubDate></item></channel></rss>