MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / ElaProgressBar

Method ElaProgressBar

ElaWidgetTools/ElaProgressBar.cpp:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include <QPropertyAnimation>
7#include <QStyleOption>
8
9ElaProgressBar::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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected