Navigator2Go  2.0
Manage your local Ocean Navigator installation.
SwitchWidget Class Reference

A toggleable switch widget. More...

#include <switchwidget.h>

Inheritance diagram for SwitchWidget:
Collaboration diagram for SwitchWidget:

Signals

void toggled (const bool checked)
 

Public Member Functions

 SwitchWidget (QWidget *parent=nullptr)
 
QSize sizeHint () const override
 
void setBrush (const QBrush &brsh)
 
NODISCARD auto brush () const noexcept
 
NODISCARD auto offset () const noexcept
 
void setOffset (const int o)
 

Protected Member Functions

void paintEvent (QPaintEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 
void enterEvent (QEvent *e) override
 

Properties

int offset
 
QBrush brush
 

Private Attributes

bool m_switch {true}
 
qreal m_opacity {0.0}
 
int m_x
 
int m_y
 
int m_width {50}
 
int m_height {16}
 
int m_margin {3}
 
QBrush m_thumb {"#d5d5d5"}
 
QBrush m_track
 
QBrush m_brush
 
QPropertyAnimation * m_anim {nullptr}
 

Detailed Description

A toggleable switch widget.


The documentation for this class was generated from the following files: