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

Method ElaLCDNumber

ElaWidgetTools/ElaLCDNumber.cpp:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7#include <QDateTime>
8#include <QDebug>
9#include <QTimer>
10
11ElaLCDNumber::ElaLCDNumber(QWidget* parent)
12 : QLCDNumber(parent), d_ptr(new ElaLCDNumberPrivate)
13{
14 Q_D(ElaLCDNumber);
15 d->q_ptr = this;
16 d->_pIsUseAutoClock = false;
17 d->_pAutoClockFormat = "yyyy-MM-dd hh:mm:ss";
18 setDigitCount(d->_pAutoClockFormat.length());
19 setSegmentStyle(QLCDNumber::Flat);
20 setObjectName("ElaLCDNumber");
21 setStyleSheet("#ElaLCDNumber{background-color:transparent;}");
22 d->_lcdNumberStyle = new ElaLCDNumberStyle();
23 d->_lcdNumberStyle->setParent(this);
24 setStyle(d->_lcdNumberStyle);
25 d->_clockTimer = new QTimer(this);
26 connect(d->_clockTimer, &QTimer::timeout, this, [=]() {
27 display(QDateTime::currentDateTime().toString(d->_pAutoClockFormat));
28 });
29
30 d->onThemeModeChanged(eTheme->getThemeMode());
31 connect(eTheme, &ElaTheme::themeModeChanged, d, &ElaLCDNumberPrivate::onThemeModeChanged);

Callers

nothing calls this directly

Calls 2

getThemeModeMethod · 0.80
onThemeModeChangedMethod · 0.45

Tested by

no test coverage detected