<?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[Regarding verticle slider in Qml]]></title><description><![CDATA[<p dir="auto">Hi all,<br />
I am using slider in my project, i have customized the slider with groove and handle, as i know by default the slider orientation is Qt.Horizontal, but when i change it to Qt.Vertical i am not able to see the customized slider, only handle i am able to see and no groove<br />
what changes i have to make in my code. i tried with changing the width and height of the groove but didn't get the output. but when i remove the groove part i am able to get the slider.</p>
<p dir="auto">Here is my code:</p>
<pre><code>import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Window {
    visible: true
    width: 640
    height: 480

    Slider {
        id: theSlider

        property alias sliderWidth: theSlider.width
        property alias sliderValue: theSlider.value

        width:250
        maximumValue: 100
        minimumValue: 0
        value:0
        orientation: Qt.Vertical
        anchors.centerIn: parent
        updateValueWhileDragging : true
        style: SliderStyle {
            groove:  Rectangle {
                id: grooveMainrect
                height: 5
                antialiasing: true
                radius: 5
                color: "#847878"
                Rectangle {
                    id: groovechildrect
                    width: (parent.width * theSlider.value)/theSlider.maximumValue
                    height: parent.height
                    color: Qt.lighter("#7ea6d6", 1.2)
                    radius: parent.radius
                }
            }

            handle: Rectangle {
                id:handlemainrect
                height: (handlechildrect.height/3)+2
                width: (handlechildrect.width/3)+2
                radius: handlechildrect.width/2
                anchors.verticalCenter: parent.verticalCenter
                color: Qt.lighter("#7ea6d6", 1.2)
                Rectangle {
                    id: handlechildrect
                    width: 25
                    height: 25
                    anchors.centerIn: parent
                    color: "#000000"
                    radius: width/2
                    opacity: 0.5
                }
            }
        }
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/80240/regarding-verticle-slider-in-qml</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 01:36:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/80240.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 12 Jun 2017 12:49:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regarding verticle slider in Qml on Tue, 13 Jun 2017 09:24:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p3c0">@<bdi>p3c0</bdi></a> One more thing, when i am increasing the value of the slider i am seeing decrease in the slider handle position, for example, i f i give slider value as 80, the actual slider handle will be appearing at 20. what is the mistake?</p>
]]></description><link>https://forum.qt.io/post/399166</link><guid isPermaLink="true">https://forum.qt.io/post/399166</guid><dc:creator><![CDATA[Naveen_D]]></dc:creator><pubDate>Tue, 13 Jun 2017 09:24:26 GMT</pubDate></item><item><title><![CDATA[Reply to Regarding verticle slider in Qml on Tue, 13 Jun 2017 05:54:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/naveen_d">@<bdi>Naveen_D</bdi></a> Hmm, something strange. If you give width and height to slider then its default value is set to maximum whereas if not given then it is set to minimum. Here are 2 cases:</p>
<pre><code>//Works as expected
Item {
    width: 300
    height: 300

    Slider {
        orientation: Qt.Vertical
    }
}

//This doesn't
Item {
    width: 300
    height: 300

    Slider {
        width: 200
        height: 200
        orientation: Qt.Vertical
    }
}
</code></pre>
<p dir="auto">Could this be a bug @jpnurmi ?</p>
]]></description><link>https://forum.qt.io/post/399111</link><guid isPermaLink="true">https://forum.qt.io/post/399111</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Tue, 13 Jun 2017 05:54:28 GMT</pubDate></item><item><title><![CDATA[Reply to Regarding verticle slider in Qml on Tue, 13 Jun 2017 05:15:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p3c0">@<bdi>p3c0</bdi></a> Ya i got that..thanks. but my slider is not starting with the minimum value, by default the handle will be at the max value.</p>
]]></description><link>https://forum.qt.io/post/399102</link><guid isPermaLink="true">https://forum.qt.io/post/399102</guid><dc:creator><![CDATA[Naveen_D]]></dc:creator><pubDate>Tue, 13 Jun 2017 05:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to Regarding verticle slider in Qml on Tue, 13 Jun 2017 04:16:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/naveen_d">@<bdi>Naveen_D</bdi></a> Always provide <code>width</code> and <code>height</code>. You are missing <code>height</code>.</p>
]]></description><link>https://forum.qt.io/post/399086</link><guid isPermaLink="true">https://forum.qt.io/post/399086</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Tue, 13 Jun 2017 04:16:19 GMT</pubDate></item></channel></rss>