Example #1
0
void PieSliceAnimation::updateValue(const PieSliceData &endValue)
{
    if (state() != QAbstractAnimation::Stopped)
        stop();

    setKeyValueAt(0.0, qVariantFromValue(m_currentValue));
    setKeyValueAt(1.0, qVariantFromValue(endValue));
}
Example #2
0
        void user_info::set_text_color_to(const QColor& c)
        {
            if(c == _text_color) return;

            auto a = new QPropertyAnimation{this, "text_color"};
            a->setDuration(600);
            a->setKeyValueAt(0, _text_color);
            a->setKeyValueAt(0.50, QColor{255, 255, 255});
            a->setKeyValueAt(1.0, c);
            a->start(QAbstractAnimation::DeleteWhenStopped);
        }
void QVariantAnimation::setEndValue(const QVariant &value)
{
    setKeyValueAt(1, value);
}
void QVariantAnimation::setStartValue(const QVariant &value)
{
    setKeyValueAt(0, value);
}