| 6 | #include <QPropertyAnimation> |
| 7 | #include <QStyleOption> |
| 8 | |
| 9 | ElaProgressBar::ElaProgressBar(QWidget* parent) |
| 10 | : QProgressBar(parent), d_ptr(new ElaProgressBarPrivate()) |
| 11 | { |
| 12 | Q_D(ElaProgressBar); |
| 13 | setObjectName("ElaProgressBar"); |
| 14 | setStyleSheet("#ElaProgressBar{background-color:transparent;}"); |
| 15 | d->q_ptr = this; |
| 16 | d->_style = new ElaProgressBarStyle(style()); |
| 17 | d->_style->setParent(this); |
| 18 | setStyle(d->_style); |
| 19 | d->_busyAnimation = new QPropertyAnimation(d->_style, "busyStartValue", this); |
| 20 | connect(d->_busyAnimation, &QPropertyAnimation::valueChanged, this, [=](const QVariant& value) { |
| 21 | d->_style->setProperty("busyEndValue", value.toInt() + 75); |
| 22 | update(); |
| 23 | }); |
| 24 | d->_busyAnimation->setDuration(2000); |
| 25 | d->_busyAnimation->setLoopCount(-1); |
| 26 | } |
| 27 |
nothing calls this directly
no outgoing calls
no test coverage detected