<?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[[Solved]Qt : Animation Issue in Progress Bar]]></title><description><![CDATA[<p dir="auto">Hi Everyone,<br />
I'm trying to have a animation in progress bar.<br />
The behaviour is as follows.<br />
We have a series of small rectangles in line(imagine dotted line) in my QML page. Now we have to get a slider in rectangle shape slightly bigger in size which moves over those small rectangles in line, like its stepping on those rectangle by rectangle</p>
<p dir="auto">Below is my tried code.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/import">@<bdi>import</bdi></a> QtQuick 1.1</p>
<p dir="auto">Rectangle {<br />
id: container</p>
<pre><code>width: 500; height: 400

Row {
    id:repeaterid
    x: 75
    y: 280
    anchors.bottom: parent.bottom
    anchors.bottomMargin: 114
    spacing: 4
    Repeater {
        model: 50
        Rectangle {
            id: smallrect
            color: "lightblue"
            width:4
            height:4}
    }

}
Rectangle {
    x: repeaterid.x
    y: repeaterid.y
    width: 6; height: 6
    color: "blue"

    SequentialAnimation on x {

        PropertyAnimation { to: 440; duration: 5000 }
        PropertyAnimation { to: repeaterid.x; duration: 0 }
    }

}
</code></pre>
<p dir="auto">}@</p>
<p dir="auto">I hope once you go through code you can get the required animation which I tried to achieve .</p>
<p dir="auto">Currently am getting a smooth transition over dotted line, it does not give stepping animation.<br />
How to approach for it?</p>
]]></description><link>https://forum.qt.io/topic/21022/solved-qt-animation-issue-in-progress-bar</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 10:38:56 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/21022.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Oct 2012 15:07:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Solved]Qt : Animation Issue in Progress Bar on Fri, 02 Nov 2012 09:20:12 GMT]]></title><description><![CDATA[<p dir="auto">I tried to improvise more in this respect. What am doing is increasing the size of trailing rectangles when the slider moves on. Initially I tried to use spacing in row for that but that wasn't working. So I went with below approach..but am getting very weird output</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/import">@<bdi>import</bdi></a> QtQuick 1.1</p>
<p dir="auto">Rectangle {<br />
id: container</p>
<p dir="auto">width: 867; height: 520<br />
color: "black"</p>
<p dir="auto">property int indexCurrent: 0</p>
<p dir="auto">Row {<br />
id:repeaterid<br />
x: 352<br />
y: 330<br />
anchors.horizontalCenter: parent.horizontalCenter<br />
anchors.bottom: parent.bottom<br />
anchors.bottomMargin: 65<br />
spacing: 10<br />
Repeater {<br />
id: repeater<br />
model: 30<br />
Rectangle { id: smallrect; color: "lightblue"; width:10; height:10}<br />
}</p>
<p dir="auto">}</p>
<p dir="auto">Row {<br />
id:repeateblankrid<br />
x: repeaterid.x+10<br />
y: repeaterid.y</p>
<pre><code>  anchors.bottomMargin: 65
  spacing: 10

     Repeater {
      id: repeaterblank
      model: 30
      Rectangle { id: blank; color: "black"; width:10; height:10}
  }
</code></pre>
<p dir="auto">}<br />
//((container.width -((container.width -(repeater.width<em>100)+(repeaterid.spacing</em>99))/2)))+ ((repeater.width<em>100)+repeaterid.spacing</em>99)<br />
Timer {<br />
id: progressTimer<br />
interval: 100<br />
running: true<br />
repeat: true<br />
onTriggered: {<br />
if (slider.x &lt; 730)<br />
{<br />
slider.x += repeaterid.spacing + 10<br />
repeater.itemAt(indexCurrent).color = "blue"<br />
repeaterblank.itemAt(indexCurrent).width = 8<br />
repeater.itemAt(indexCurrent).width = 12<br />
repeater.itemAt(indexCurrent).height = 12<br />
indexCurrent = indexCurrent + 1<br />
}</p>
<pre><code>}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">Rectangle {<br />
id: slider<br />
x: repeaterid.x<br />
y: repeaterid.y<br />
width: 14; height: 14<br />
color: "blue"<br />
}<br />
}@</p>
]]></description><link>https://forum.qt.io/post/155986</link><guid isPermaLink="true">https://forum.qt.io/post/155986</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 02 Nov 2012 09:20:12 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Qt : Animation Issue in Progress Bar on Thu, 01 Nov 2012 06:31:54 GMT]]></title><description><![CDATA[<p dir="auto">Thanks mate :)<br />
I have also tried with trigger but didn't used smartly enough.</p>
]]></description><link>https://forum.qt.io/post/155896</link><guid isPermaLink="true">https://forum.qt.io/post/155896</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 01 Nov 2012 06:31:54 GMT</pubDate></item><item><title><![CDATA[Reply to [Solved]Qt : Animation Issue in Progress Bar on Wed, 31 Oct 2012 15:27:54 GMT]]></title><description><![CDATA[<p dir="auto">Maybe you can use "Timer":<a href="http://qt-project.org/doc/qt-4.8/qml-timer.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-4.8/qml-timer.html</a><br />
@</p>
<p dir="auto">import QtQuick 1.1</p>
<p dir="auto">Rectangle {<br />
id: container</p>
<pre><code>width: 500; height: 400

Row {
    id:repeaterid
    x: 75
    y: 280
    anchors.bottom: parent.bottom
    anchors.bottomMargin: 114
    spacing: 4
    Repeater {
        model: 50
        Rectangle {
            id: smallrect
            color: "lightblue"
            width:4
            height:4
        }
    }
}

Timer {
    id: progressTimer
    interval: 50
    running: true
    repeat: true
    onTriggered: {
        if (slider.x &lt; 450)
            slider.x += repeaterid.spacing + 4
    }
}

Rectangle {
    id: slider
    x: repeaterid.x
    y: repeaterid.y
    width: 6; height: 6
    color: "blue"
}
</code></pre>
<p dir="auto">}<br />
@</p>
]]></description><link>https://forum.qt.io/post/155876</link><guid isPermaLink="true">https://forum.qt.io/post/155876</guid><dc:creator><![CDATA[beemaster]]></dc:creator><pubDate>Wed, 31 Oct 2012 15:27:54 GMT</pubDate></item></channel></rss>