CCIMXDesktop
 
Loading...
Searching...
No Matches
DateIcon Class Reference

A widget that displays a date in an icon-like format. More...

#include <DateIcon.h>

Inheritance diagram for DateIcon:

Public Member Functions

 DateIcon (QWidget *parent=nullptr)
 Constructs a DateIcon widget.
 
QSize sizeHint () const override
 Gets the recommended size for the widget.
 
int heightForWidth (int width) const override
 Calculates height for a given width.
 
void setHandleDate (const QDate &date)
 Sets the date to display.
 
QDate handleDate () const
 Gets the current display date.
 

Static Public Member Functions

static QPixmap generateCalendarIcon (int width, int height, const QDate &date, bool darkMode=false)
 Generates a calendar icon pixmap.
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Handles paint events.
 

Detailed Description

A widget that displays a date in an icon-like format.

Generates a calendar-style icon showing the specified date.

Constructor & Destructor Documentation

◆ DateIcon()

DateIcon::DateIcon ( QWidget *  parent = nullptr)
explicit

Constructs a DateIcon widget.

Parameters
parentThe parent widget

Member Function Documentation

◆ generateCalendarIcon()

QPixmap DateIcon::generateCalendarIcon ( int  width,
int  height,
const QDate &  date,
bool  darkMode = false 
)
static

Generates a calendar icon pixmap.

Parameters
widthThe desired width
heightThe desired height
dateThe date to display
darkModeWhether to use dark mode colors
Returns
The generated pixmap

◆ handleDate()

QDate DateIcon::handleDate ( ) const
inline

Gets the current display date.

Returns
The current date

◆ heightForWidth()

int DateIcon::heightForWidth ( int  width) const
override

Calculates height for a given width.

Parameters
widthThe width to calculate height for
Returns
The appropriate height

◆ paintEvent()

void DateIcon::paintEvent ( QPaintEvent *  event)
overrideprotected

Handles paint events.

Parameters
eventThe paint event

◆ setHandleDate()

void DateIcon::setHandleDate ( const QDate &  date)
inline

Sets the date to display.

Parameters
dateThe date to display

◆ sizeHint()

QSize DateIcon::sizeHint ( ) const
override

Gets the recommended size for the widget.

Returns
The recommended size

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