Wavelength
Privacy-focused, cross-platform, and open-source communication application
Loading...
Searching...
No Matches
CyberCheckBox Class Referencefinal

A custom QCheckBox styled with a cyberpunk aesthetic. More...

#include <cyber_checkbox.h>

Inheritance diagram for CyberCheckBox:
Collaboration diagram for CyberCheckBox:

Public Member Functions

 CyberCheckBox (const QString &text, QWidget *parent=nullptr)
 Constructs a CyberCheckBox. Initializes the checkbox with text, applies basic styling (spacing, background, color, font) via stylesheet, and sets a minimum height.
 
double GetGlowIntensity () const
 Gets the current intensity of the glow effect.
 
void SetGlowIntensity (double intensity)
 Sets the intensity of the glow effect. Triggers a repaint of the checkbox.
 
QSize sizeHint () const override
 Returns the recommended size for the checkbox. Ensures a minimum height is respected.
 

Protected Member Functions

void enterEvent (QEvent *event) override
 Overridden enter event handler. Animates the glow intensity to a higher value.
 
void leaveEvent (QEvent *event) override
 Overridden leave event handler. Animates the glow intensity back to its default value.
 
void paintEvent (QPaintEvent *event) override
 Overridden paint event handler. Draws the custom checkbox appearance. Renders the clipped square indicator (background, border, glow), the 'X' checkmark if checked, and the label text using the specified cyberpunk style.
 

Properties

double glowIntensity
 Property controlling the intensity of the checkbox border glow (0.0 to 1.0+). Animatable.
 

Private Attributes

double glow_intensity_
 Current intensity of the glow effect. Modified by animations on hover.
 

Detailed Description

A custom QCheckBox styled with a cyberpunk aesthetic.

This checkbox features a custom-drawn square indicator with clipped corners, a neon blue border, and a subtle glow effect that animates on hover. The checkmark is rendered as a stylized 'X'. The text uses a specific cyberpunk-themed font and color.

Constructor & Destructor Documentation

◆ CyberCheckBox()

CyberCheckBox::CyberCheckBox ( const QString & text,
QWidget * parent = nullptr )
explicit

Constructs a CyberCheckBox. Initializes the checkbox with text, applies basic styling (spacing, background, color, font) via stylesheet, and sets a minimum height.

Parameters
textThe label text for the checkbox.
parentOptional parent widget.

Member Function Documentation

◆ enterEvent()

void CyberCheckBox::enterEvent ( QEvent * event)
overrideprotected

Overridden enter event handler. Animates the glow intensity to a higher value.

Parameters
eventThe enter event.

◆ GetGlowIntensity()

double CyberCheckBox::GetGlowIntensity ( ) const
inline

Gets the current intensity of the glow effect.

Returns
The glow intensity value (typically 0.5 to 0.9).

◆ leaveEvent()

void CyberCheckBox::leaveEvent ( QEvent * event)
overrideprotected

Overridden leave event handler. Animates the glow intensity back to its default value.

Parameters
eventThe leave event.

◆ paintEvent()

void CyberCheckBox::paintEvent ( QPaintEvent * event)
overrideprotected

Overridden paint event handler. Draws the custom checkbox appearance. Renders the clipped square indicator (background, border, glow), the 'X' checkmark if checked, and the label text using the specified cyberpunk style.

Parameters
eventThe paint event.

◆ SetGlowIntensity()

void CyberCheckBox::SetGlowIntensity ( double intensity)

Sets the intensity of the glow effect. Triggers a repaint of the checkbox.

Parameters
intensityThe desired glow intensity.

◆ sizeHint()

QSize CyberCheckBox::sizeHint ( ) const
override

Returns the recommended size for the checkbox. Ensures a minimum height is respected.

Returns
The calculated QSize hint.

Member Data Documentation

◆ glow_intensity_

double CyberCheckBox::glow_intensity_
private

Current intensity of the glow effect. Modified by animations on hover.

Property Documentation

◆ glowIntensity

double CyberCheckBox::glowIntensity
readwrite

Property controlling the intensity of the checkbox border glow (0.0 to 1.0+). Animatable.


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