<?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[Drawing a shining effect animation]]></title><description><![CDATA[<p dir="auto">I'm trying to get a "shining" animation like this:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/613b9e81-79fd-4ccc-982e-ea75483d8bbe.gif" alt="brave_rl8mRoeJG3.gif" class=" img-fluid img-markdown" /></p>
<p dir="auto">but instead of starting the animation from the <strong>top-right</strong> to the bottom-left<br />
start it from the <strong>bottom-left</strong> to the top-right</p>
<p dir="auto">This is what I got so far with my class below:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/68641919-e743-4da1-ba5f-6ecc17ee271a.gif" alt="QtWidgetsApplication10_L6eCv6Gz9T.gif" class=" img-fluid img-markdown" /></p>
<p dir="auto">It should be something like <code>\ \\ \\\ \\\\ ...</code><br />
currently, it's <code>/ // /// //// ...</code> and at the end its wrong as seen in the gif.</p>
<p dir="auto">I'm struggling with how to calculate the <strong>start</strong> and <strong>end</strong> values of the linear gradient animation to achieve the mentioned direction:</p>
<pre><code>startAnimation-&gt;setStartValue(QPointF(-width(), -height()));
startAnimation-&gt;setEndValue(QPointF(width(), height()));

endAnimation-&gt;setStartValue(QPointF(0, 0));
endAnimation-&gt;setEndValue(QPointF(2 * width(), 2 * height()));
</code></pre>
<pre><code>class ShineButton: public QPushButton
{
    Q_OBJECT

public:
    Q_PROPERTY(QPointF shineStartPoint READ shineStartPoint WRITE setShineStartPoint)
    Q_PROPERTY(QPointF shineEndPoint READ shineEndPoint WRITE setShineEndPoint)

public:
    QTimer* timer = nullptr;
    int borderRadius = 12;
    QPointF m_shineStartPoint;
    QPointF m_shineEndPoint;

    ShineButton(QWidget* parent = nullptr) : QPushButton(parent)  {  setAnimation(1000, 2000);  };

    QPointF shineStartPoint() const { return m_shineStartPoint; }
    void setShineStartPoint(const QPointF&amp; point) { m_shineStartPoint = point; update(); }
    QPointF shineEndPoint() const { return m_shineEndPoint; }
    void setShineEndPoint(const QPointF&amp; point) { m_shineEndPoint = point; update(); }

    void setAnimation(int duration, int interval)
    {
        QPropertyAnimation *startAnimation = new QPropertyAnimation(this, "shineStartPoint");
        startAnimation-&gt;setStartValue(QPointF(-width(), -height()));
        startAnimation-&gt;setEndValue(QPointF(width(), height()));
        startAnimation-&gt;setDuration(duration);
        startAnimation-&gt;setEasingCurve(QEasingCurve::Linear);

        QPropertyAnimation *endAnimation = new QPropertyAnimation(this, "shineEndPoint");
        endAnimation-&gt;setStartValue(QPointF(0, 0));
        endAnimation-&gt;setEndValue(QPointF(2 * width(), 2 * height()));
        endAnimation-&gt;setDuration(duration);
        endAnimation-&gt;setEasingCurve(QEasingCurve::Linear);

        startAnimation-&gt;start();
        endAnimation-&gt;start();

        timer = new QTimer(this);
        timer-&gt;start(interval);
        connect(timer, &amp;QTimer::timeout, this, [=]()
        {
		startAnimation-&gt;start();
		endAnimation-&gt;start();
	});
    }
    void paintEvent(QPaintEvent* event) override
    {
        QPainter painter(this);
        painter.setRenderHint(QPainter::Antialiasing, true);

        // BACKGROUND
        painter.setPen(Qt::transparent);
        painter.setBrush(QColor("#202225"));
        painter.drawRoundedRect(rect(), borderRadius, borderRadius);

        // LINEAR GRADIENT
        QLinearGradient linearGrad(m_shineStartPoint, m_shineEndPoint);
        linearGrad.setColorAt(0, Qt::transparent);
        linearGrad.setColorAt(0.5, Qt::white);
        linearGrad.setColorAt(1, Qt::transparent);
        painter.setBrush(linearGrad);
        painter.drawRoundedRect(rect(), borderRadius, borderRadius);
    }
};

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindowClass())
{
    ui-&gt;setupUi(this);
    ShineButton* button = new ShineButton(this);
    button -&gt;setGeometry(200, 200, 140, 40);
    button-&gt;show();    
}



</code></pre>
]]></description><link>https://forum.qt.io/topic/145883/drawing-a-shining-effect-animation</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 20:38:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145883.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Jun 2023 16:42:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 27 Jun 2023 14:16:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762484">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">I had asked for the code you used on your gif nothing more, doesn't matter what you modified.</p>
</blockquote>
<p dir="auto">tbh, I didn't modified that much... I changed the coodinates as I already told you, changed the place in my code where I actually resize (it will already work when you put the resize before <code>setAnimation</code>. No dynamic resizing but for a static button) and played around with the "size" ( = stretch) of the gradient...<br />
You can stretch the gradient by adding multiples of your width and height to the start/end position.</p>
<p dir="auto">There is no "one" version of code. Cant remember the size of the button, but IIRC I doubled the size by using 4 instead of 2.</p>
<p dir="auto">So instead of</p>
<pre><code>endAnimation-&gt;setStartValue(QPointF(0, height()));
endAnimation-&gt;setEndValue(QPointF(2 * width(), - height()));
</code></pre>
<p dir="auto">I use for example:</p>
<pre><code>endAnimation-&gt;setStartValue(QPointF(0, height() * 2));
endAnimation-&gt;setEndValue(QPointF(2 * 2 * width(), - height() * 2));
</code></pre>
]]></description><link>https://forum.qt.io/post/762681</link><guid isPermaLink="true">https://forum.qt.io/post/762681</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Tue, 27 Jun 2023 14:16:59 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 19:33:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> said in <a href="/post/762481">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">Like you ignored what I wrote?! ;-)</p>
</blockquote>
<p dir="auto">I don't, if I had understood I wasn't still asking.</p>
<blockquote>
<p dir="auto">I wont code the complete resize handling for you...</p>
</blockquote>
<p dir="auto">I'm not asking for this, I had asked for the code you used on your gif nothing more, doesn't matter what you modified.</p>
]]></description><link>https://forum.qt.io/post/762484</link><guid isPermaLink="true">https://forum.qt.io/post/762484</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Fri, 23 Jun 2023 19:33:45 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 18:52:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762479">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">share the code you use, ignore the one i post</p>
</blockquote>
<p dir="auto">Like you ignored what I wrote?! ;-)</p>
<p dir="auto">You have more than you need to figure out how to solve it.<br />
I wont code the complete resize handling for you...</p>
<p dir="auto">To quickly get what I did, set the geometry <strong>before</strong> setting up your animation with <code>setAnimation</code> (or change the structure completely) and then don't resize your button. It will work until the size changes.</p>
<p dir="auto">For example like this:</p>
<pre><code>ShineButton(QWidget* parent = nullptr) : QPushButton(parent) 
{  
    setGeometry(200, 200, 140, 40);
    setAnimation(1000, 2000); 
};
</code></pre>
<p dir="auto">If you want your animation to update "live" according to your button size, you have to use the <code>resizeEvent</code> anyway and reset the start- and endpoints of your gradient to match your button's new size.</p>
<ul>
<li><a href="https://doc.qt.io/qt-6/qwidget.html#resizeEvent" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qwidget.html#resizeEvent</a></li>
</ul>
<p dir="auto">As it is now, while the gradient animation is running, it won't react on any size changes, as you called <code>setAnimation</code> once in your constructor.</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://forum.qt.io/post/762481</link><guid isPermaLink="true">https://forum.qt.io/post/762481</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Fri, 23 Jun 2023 18:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 17:38:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> said in <a href="/post/762440">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">My coordinates are evenly distributed before and after the button,</p>
</blockquote>
<p dir="auto">share the code you use, ignore the one i post</p>
]]></description><link>https://forum.qt.io/post/762479</link><guid isPermaLink="true">https://forum.qt.io/post/762479</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Fri, 23 Jun 2023 17:38:10 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 11:56:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/79889a0a-92d8-4307-860a-e2867b5dc2e6.png" alt="GradientButton_withMarkers.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The points used by @J-Hilk are marked with white circles, the points I use have blue markers.<br />
I tested it again now and @J-Hilk 's approach worked for me as well.<br />
My coordinates are evenly distributed before and after the button, while @J-Hilk included the ( 0 / 0 ) point in his approach and therefore the "fade in" time is shorter, than the "fade out" time (not the actual animation time, but the time where you see the gradient moving over the visible button area).<br />
After all it's a matter of taste how you do it and which points you use for better understanding.</p>
<p dir="auto">The reason why your gradient still stops before leaving the button, even when using @J-Hilk 's or my points, I can't tell at the moment.<br />
Could be an issue with your overall design ( I only used the content of <code>setAnimation</code> function inside the c'tor and the <code>paintEvent</code> from your class).</p>
<p dir="auto">Edit:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/761940">Drawing a shining effect animation</a>:</p>
<blockquote>
<pre><code>ShineButton* button = new ShineButton(this);
button -&gt;setGeometry(200, 200, 140, 40);
button-&gt;show();    
</code></pre>
</blockquote>
<p dir="auto">I'm just seeing this right now...<br />
You don't have real "resize handling", which is needed to have the right angles and starting/stopping points at all time.<br />
You call <code>setAnimation</code> only once in your c'tor, set the points and start the property animation. Then you use the animated points in your <code>paintEvent</code>, which is not "wrong", but after resizing your button manually after calling its c'tor here</p>
<pre><code>ShineButton* button = new ShineButton(this);
button -&gt;setGeometry(200, 200, 140, 40);
</code></pre>
<p dir="auto">the <code>shine(Start/End)Point</code> values are already off... because they are still configured to the initial button size, which was set in c'tor or by button's parent layout, if any (I know you used it as stand-alone widget), while the animation keeps running and using the initial values.</p>
<p dir="auto">Just paint these points with <code>painter.drawPoint(....)</code> in your <code>paintEvent</code> using a thick <code>QPen</code> with a bright color and you will see where your gradient is actually moving and where it is stopping ;-)</p>
]]></description><link>https://forum.qt.io/post/762440</link><guid isPermaLink="true">https://forum.qt.io/post/762440</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Fri, 23 Jun 2023 11:56:24 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 10:26:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> why you cant share the code you used? it would be easy to me understand reading it, i already told you many times im having difficult in understand this.</p>
]]></description><link>https://forum.qt.io/post/762429</link><guid isPermaLink="true">https://forum.qt.io/post/762429</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Fri, 23 Jun 2023 10:26:28 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Fri, 23 Jun 2023 02:55:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762379">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">I see the graphic you post but I still didn't understand</p>
</blockquote>
<p dir="auto">How?! :D<br />
But, trust me, you need to, otherwise you won't be able to maintain your code or don't know what's going on when you come back to it later.</p>
<p dir="auto">Understanding of the coordinate system is essential for every painting, widget movement, layouting, coordinate mapping and everything else.</p>
<p dir="auto">The graphic is probably the best illustration of your issue/situation you can get. You know how to read a coordinate system, right?<br />
You just have to pick 4 points from there.</p>
<ul>
<li>You want the end of your gradient moving completely out of your visible button rect.</li>
<li>The gradient moves from bottom-left to top-right.</li>
</ul>
<p dir="auto">The yellow and red lines are already possible ways to get what I did.<br />
Solid line for the beginning of the animation and the dashed lines for the end.<br />
Yellow the start and red the endpoint of every "event".<br />
The black, dashed line with the arrow in the middle show the "movement" of the gradient</p>
]]></description><link>https://forum.qt.io/post/762382</link><guid isPermaLink="true">https://forum.qt.io/post/762382</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Fri, 23 Jun 2023 02:55:18 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Thu, 22 Jun 2023 20:32:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> I'm using the code i posted in my first answer, then I modified the coordinates to</p>
<pre><code>startAnimation-&gt;setStartValue(QPointF(-width(), height()));
startAnimation-&gt;setEndValue(QPointF(width(), -height()));
and
endAnimation-&gt;setStartValue(QPointF(0, 0));
endAnimation-&gt;setEndValue(QPointF(2 * width(), 2 * -height()));
</code></pre>
<p dir="auto">as J.Hilk suggested, then I'm getting the wrong animation end as I posted in the gif above</p>
<p dir="auto">I see the graphic you post but I still didn't understand what you did to reach the result in your gif (I'm not referring to the loop count).<br />
I meant if you could share your code edited with the fixes?</p>
]]></description><link>https://forum.qt.io/post/762379</link><guid isPermaLink="true">https://forum.qt.io/post/762379</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Thu, 22 Jun 2023 20:32:51 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Thu, 22 Jun 2023 16:20:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762350">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">The struggle is real</p>
</blockquote>
<p dir="auto">What are you struggling with? Still the coordinates?!</p>
]]></description><link>https://forum.qt.io/post/762353</link><guid isPermaLink="true">https://forum.qt.io/post/762353</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Thu, 22 Jun 2023 16:20:51 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Thu, 22 Jun 2023 16:08:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> said in <a href="/post/762294">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">Looks about like this<br />
Happy coding :)</p>
</blockquote>
<p dir="auto">The struggle is real, I'm trying to achieve exactly the effect on your gif, could you please share the code you used? 🙏</p>
]]></description><link>https://forum.qt.io/post/762350</link><guid isPermaLink="true">https://forum.qt.io/post/762350</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Thu, 22 Jun 2023 16:08:13 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Thu, 22 Jun 2023 14:34:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/1ba4fcf7-99da-4733-bf13-5661d2b95017.png" alt="GradientButton.drawio.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Should be self-explanatory ;-)</p>
<p dir="auto">Pick any known point.</p>
<p dir="auto">Dark gray: your button in its own coordinate system<br />
light gray: virtual button rect before and after the animation</p>
<p dir="auto">yellow thick line: gradient <strong>start point</strong> at the <strong>beginning</strong><br />
yellow dashed line: gradient <strong>start point</strong> at the <strong>end</strong> of animation</p>
<p dir="auto">red thick line:  gradient <strong>end point</strong> at the <strong>beginning</strong><br />
red dashed line: gradient <strong>end point</strong> at the <strong>end</strong> of animation</p>
<p dir="auto">This should keep a fitting gradient angle, even when you have high aspect ratios of like 20:1 or more.</p>
<blockquote>
<p dir="auto">how to measure its length</p>
</blockquote>
<p dir="auto">You dont have to measure it in numbers, which would also be not too complicated since the gradient is "traveling" basically on a hypotenuse of a triangle. So the diagonal lenght is</p>
<pre><code>c = sqrt( a^2 + b^2 )
</code></pre>
<p dir="auto">with a = width and b = height.</p>
<p dir="auto">Btw: if you need continuous looping, you can add</p>
<pre><code>        startAnimation-&gt;setLoopCount(-1);
        endAnimation-&gt;setLoopCount(-1);
</code></pre>
<p dir="auto">and get rid of the timer.</p>
<p dir="auto">Looks about like this</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/1a9b6eba-1242-4868-811a-263ef4da9450.gif" alt="ShineButton.gif" class=" img-fluid img-markdown" /></p>
<p dir="auto">Happy coding :)</p>
]]></description><link>https://forum.qt.io/post/762294</link><guid isPermaLink="true">https://forum.qt.io/post/762294</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Thu, 22 Jun 2023 14:34:55 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Wed, 21 Jun 2023 20:12:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pl45m4">@<bdi>Pl45m4</bdi></a> said in <a href="/post/762097">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">Because the <code>startAnimation</code> has reached its end point. The end point of start is not far enough for the gradient to disappear from the visible button area.<br />
You need to take the length of the gradient into account. It is measured from the front.</p>
</blockquote>
<p dir="auto">I didn't understand how to measure its length, could you point it?</p>
]]></description><link>https://forum.qt.io/post/762280</link><guid isPermaLink="true">https://forum.qt.io/post/762280</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Wed, 21 Jun 2023 20:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Wed, 21 Jun 2023 12:56:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762081">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">any idea why it's not completly disappearing at the end?</p>
</blockquote>
<p dir="auto">Because the <code>startAnimation</code> has reached its end point. The end point of start is not far enough for the gradient to disappear from the visible button area.<br />
You need to take the length of the gradient into account. It is measured from the front.</p>
]]></description><link>https://forum.qt.io/post/762097</link><guid isPermaLink="true">https://forum.qt.io/post/762097</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Wed, 21 Jun 2023 12:56:00 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 20 Jun 2023 13:27:50 GMT]]></title><description><![CDATA[<p dir="auto">@J-Hilk said in <a href="/post/762077">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> well, to flip the direction, inverse the y values</p>
<p dir="auto">startAnimation-&gt;setStartValue(QPointF(-width(), height()));<br />
startAnimation-&gt;setEndValue(QPointF(width(), -height()));</p>
<p dir="auto">and</p>
<p dir="auto">endAnimation-&gt;setStartValue(QPointF(0, 0));<br />
endAnimation-&gt;setEndValue(QPointF(2 * width(), 2 * -height()));</p>
</blockquote>
<p dir="auto">Yes, this is the direction i was referring to, thanks, any idea why it's not completly disappearing at the end?<br />
<img src="https://ddgobkiprc33d.cloudfront.net/eb4f02b1-16ba-410d-99ec-7696801105b8.gif" alt="QtWidgetsApplication10_cvZKY68ZJv.gif" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.qt.io/post/762081</link><guid isPermaLink="true">https://forum.qt.io/post/762081</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Tue, 20 Jun 2023 13:27:50 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 20 Jun 2023 13:15:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/762075">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">these values are so confuse to me, never worked with QLinearGradient.</p>
</blockquote>
<p dir="auto">This has nothing to do with the gradient itself. You need to understand what you want to do and how :)<br />
You said, you want to start <strong>bottom-left</strong> and end <strong>top-right</strong>.<br />
The coordinate system starts with ( 0 / 0 ) in the <strong>top-left</strong> corner.</p>
<p dir="auto">So your start would be ( 0 / h ) and end ( w / 0 ).</p>
<p dir="auto">That's why <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> was wondering why you have ( -w / -h ) in there. This would be a point with a distance of w and h top-left above your visible widget area.</p>
]]></description><link>https://forum.qt.io/post/762079</link><guid isPermaLink="true">https://forum.qt.io/post/762079</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Tue, 20 Jun 2023 13:15:28 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 20 Jun 2023 13:14:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> well, to flip the direction, inverse the y values</p>
<p dir="auto">startAnimation-&gt;setStartValue(QPointF(-width(), height()));<br />
startAnimation-&gt;setEndValue(QPointF(width(), -height()));</p>
<p dir="auto">and</p>
<p dir="auto">endAnimation-&gt;setStartValue(QPointF(0, 0));<br />
endAnimation-&gt;setEndValue(QPointF(2 * width(), 2 * -height()));</p>
]]></description><link>https://forum.qt.io/post/762077</link><guid isPermaLink="true">https://forum.qt.io/post/762077</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Tue, 20 Jun 2023 13:14:01 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 20 Jun 2023 13:06:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> I'm trying to make the animation start from the bottom left to the top right, you're referring to what value? start value/endvalue of startAnimation or endAnimation? these values are so confuse to me, never worked with QLinearGradient.</p>
]]></description><link>https://forum.qt.io/post/762075</link><guid isPermaLink="true">https://forum.qt.io/post/762075</guid><dc:creator><![CDATA[Ylvy]]></dc:creator><pubDate>Tue, 20 Jun 2023 13:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to Drawing a shining effect animation on Tue, 20 Jun 2023 05:30:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ylvy">@<bdi>Ylvy</bdi></a> said in <a href="/post/761940">Drawing a shining effect animation</a>:</p>
<blockquote>
<p dir="auto">-width(), -height()</p>
</blockquote>
<p dir="auto">Negative?!<br />
Top right is: width, 0<br />
Bottom left: 0, height</p>
]]></description><link>https://forum.qt.io/post/762009</link><guid isPermaLink="true">https://forum.qt.io/post/762009</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 20 Jun 2023 05:30:16 GMT</pubDate></item></channel></rss>