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

Method ElaProgressRing

ElaWidgetTools/ElaProgressRing.cpp:13–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12ELA_PROPERTY_Q_CPP(ElaProgressRing, bool, IsTransparent)
13ELA_PROPERTY_Q_CPP(ElaProgressRing, bool, IsDisplayValue)
14ELA_PROPERTY_Q_CPP(ElaProgressRing, ElaProgressRingType::ValueDisplayMode, ValueDisplayMode)
15ELA_PROPERTY_Q_CPP(ElaProgressRing, int, ValuePixelSize)
16ElaProgressRing::ElaProgressRing(QWidget* parent)
17 : QWidget(parent), d_ptr(new ElaProgressRingPrivate())
18{
19 Q_D(ElaProgressRing);
20 d->q_ptr = this;
21 d->_pIsDisplayValue = true;
22 d->_pValuePixelSize = 17;
23 d->_pValueDisplayMode = ElaProgressRingType::ValueDisplayMode::Actual;
24 d->_pMinimum = 0;
25 d->_pMaximum = 100;
26 d->_pValue = 0;
27 d->_pBusyIndex = 0xe100;
28 d->_pBusyingDurationTime = 1000;
29 d->_pBusyingWidth = 6;
30 d->_pBusyStartDeg = 0;
31 d->_pBusyContentDeg = 0;
32 d->_pIsBusying = false;
33 d->_pIsTransparent = false;
34 setFixedSize(70, 70);
35 setObjectName("ElaProgressRing");
36 setStyleSheet("#ElaProgressRing{background-color:transparent;}");
37
38 d->_busyStartDegAnimation = new QPropertyAnimation(d, "pBusyStartDeg");
39 connect(d->_busyStartDegAnimation, &QPropertyAnimation::valueChanged, this, [=]() {
40 update();
41 });
42 d->_busyStartDegAnimation->setEasingCurve(QEasingCurve::Linear);
43 d->_busyStartDegAnimation->setDuration(1000);
44 d->_busyStartDegAnimation->setStartValue(0);
45 d->_busyStartDegAnimation->setEndValue(360);
46 d->_busyStartDegAnimation->setLoopCount(-1);
47
48 d->_busyContentDegAnimation = new QPropertyAnimation(d, "pBusyContentDeg");
49 d->_busyContentDegAnimation->setEasingCurve(QEasingCurve::Linear);
50 d->_busyContentDegAnimation->setDuration(1800);
51 d->_busyContentDegAnimation->setStartValue(10);
52 d->_busyContentDegAnimation->setKeyValueAt(0.5, 140);
53 d->_busyContentDegAnimation->setEndValue(10);
54 d->_busyContentDegAnimation->setLoopCount(-1);
55
56 d->_themeMode = eTheme->getThemeMode();
57 connect(eTheme, &ElaTheme::themeModeChanged, this, [=](ElaThemeType::ThemeMode themeMode) {
58 d->_themeMode = themeMode;
59 update();
60 });
61}

Callers

nothing calls this directly

Calls 1

getThemeModeMethod · 0.80

Tested by

no test coverage detected