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

Method mouseMoveEvent

ElaWidgetTools/ElaToggleSwitch.cpp:129–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127 bool isToggled = d->_isToggled;
128 if (d->_isDragging)
129 {
130 isToggled = d->_circleCenterX > width() / 2;
131 }
132 else if (rect().contains(event->pos()))
133 {
134 isToggled = !isToggled;
135 }
136 d->_isDragging = false;
137 const int trackHeight = d->_getTrackHeight();
138 d->_startPosAnimation(d->_circleCenterX, isToggled ? width() - trackHeight / 2 - d->_margin * 2 : trackHeight / 2, isToggled);
139 d->_startRadiusAnimation(trackHeight * 0.25, trackHeight * 0.35);
140 event->accept();
141}
142
143void ElaToggleSwitch::mouseMoveEvent(QMouseEvent* event)
144{

Callers

nothing calls this directly

Calls 1

_adjustCircleCenterXMethod · 0.80

Tested by

no test coverage detected