MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / paintEvent

Method paintEvent

ElaWidgetTools/ElaCalendarPicker.cpp:55–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 d->_calendarPickerContainer->setWindowOpacity(d->_popupStartOpacity * (1 - progress));
54 }
55 else
56 {
57 d->_calendarPickerContainer->move(d->_popupPosition + QPoint(0, qRound(d->_popupOffset * (1 - progress))));
58 d->_calendarPickerContainer->setWindowOpacity(qMin(1.0, d->_popupAnimation->currentTime() / 83.0));
59 }
60 });
61 connect(d->_popupAnimation, &QVariantAnimation::finished, this, [d]() {
62 if (d->_isClosing)
63 {
64 d->_calendarPickerContainer->hide();
65 }
66 });
67 installEventFilter(d);
68 d->_calendarPickerContainer->installEventFilter(d);
69 connect(this, &QPushButton::clicked, d, &ElaCalendarPickerPrivate::onCalendarPickerClicked);
70
71 connect(d->_calendar, &ElaCalendar::pSelectedDateChanged, d, &ElaCalendarPickerPrivate::onCalendarSelectedDateChanged);
72 setSelectedDate(QDate::currentDate());
73
74 d->_themeMode = eTheme->getThemeMode();
75 connect(eTheme, &ElaTheme::themeModeChanged, this, [=](ElaThemeType::ThemeMode themeMode) { d->_themeMode = themeMode; });
76}
77
78ElaCalendarPicker::~ElaCalendarPicker()
79{
80}
81
82void ElaCalendarPicker::setSelectedDate(QDate selectedDate)
83{
84 Q_D(ElaCalendarPicker);
85 d->_calendar->setSelectedDate(selectedDate);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected