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

Method event

ElaWidgetTools/ElaToggleSwitch.cpp:54–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 d->_startPosAnimation(trackHeight / 2, width() - trackHeight / 2 - d->_margin * 2, isToggled);
53 }
54}
55
56bool ElaToggleSwitch::getIsToggled() const
57{
58 return d_ptr->_isToggled;
59}
60
61bool ElaToggleSwitch::event(QEvent* event)
62{
63 Q_D(ElaToggleSwitch);
64 const int trackHeight = d->_getTrackHeight();
65 switch (event->type())
66 {
67 case QEvent::Enter:
68 {
69 if (isEnabled())
70 {
71 d->_startRadiusAnimation(trackHeight * 0.3, trackHeight * 0.35);
72 }
73 break;
74 }
75 case QEvent::Leave:
76 {
77 if (isEnabled())
78 {
79 d->_startRadiusAnimation(trackHeight * 0.35, trackHeight * 0.3);
80 }
81 break;
82 }
83 case QEvent::MouseMove:
84 {
85 update();
86 break;
87 }
88 default:
89 {

Callers

nothing calls this directly

Calls 1

_startRadiusAnimationMethod · 0.45

Tested by

no test coverage detected