| 52 | d->_startPosAnimation(trackHeight / 2, width() - trackHeight / 2 - d->_margin * 2, isToggled); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | bool ElaToggleSwitch::getIsToggled() const |
| 57 | { |
| 58 | return d_ptr->_isToggled; |
| 59 | } |
| 60 | |
| 61 | bool 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 | { |
nothing calls this directly
no test coverage detected