A widget that displays a date in an icon-like format.
More...
#include <DateIcon.h>
|
| 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 QPixmap | generateCalendarIcon (int width, int height, const QDate &date, bool darkMode=false) |
| Generates a calendar icon pixmap.
|
|
|
void | paintEvent (QPaintEvent *event) override |
| Handles paint events.
|
|
A widget that displays a date in an icon-like format.
Generates a calendar-style icon showing the specified date.
◆ DateIcon()
DateIcon::DateIcon |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Constructs a DateIcon widget.
- Parameters
-
◆ generateCalendarIcon()
QPixmap DateIcon::generateCalendarIcon |
( |
int |
width, |
|
|
int |
height, |
|
|
const QDate & |
date, |
|
|
bool |
darkMode = false |
|
) |
| |
|
static |
Generates a calendar icon pixmap.
- Parameters
-
width | The desired width |
height | The desired height |
date | The date to display |
darkMode | Whether 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
-
width | The width to calculate height for |
- Returns
- The appropriate height
◆ paintEvent()
void DateIcon::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprotected |
Handles paint events.
- Parameters
-
◆ setHandleDate()
void DateIcon::setHandleDate |
( |
const QDate & |
date | ) |
|
|
inline |
Sets the date to display.
- Parameters
-
◆ 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:
- builtin/app/CCCalendar/ui/date_icon/DateIcon.h
- builtin/app/CCCalendar/ui/date_icon/DateIcon.cpp