chore: 格式化ElaWidgetTools代码
This commit is contained in:
@@ -6,20 +6,14 @@
|
||||
#include "ElaCalendar.h"
|
||||
#include "ElaCalendarPicker.h"
|
||||
#include "ElaCalendarPickerContainer.h"
|
||||
ElaCalendarPickerPrivate::ElaCalendarPickerPrivate(QObject* parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
}
|
||||
ElaCalendarPickerPrivate::ElaCalendarPickerPrivate(QObject *parent) : QObject{parent} {}
|
||||
|
||||
ElaCalendarPickerPrivate::~ElaCalendarPickerPrivate()
|
||||
{
|
||||
}
|
||||
ElaCalendarPickerPrivate::~ElaCalendarPickerPrivate() {}
|
||||
|
||||
void ElaCalendarPickerPrivate::onCalendarPickerClicked()
|
||||
{
|
||||
void ElaCalendarPickerPrivate::onCalendarPickerClicked() {
|
||||
Q_Q(ElaCalendarPicker);
|
||||
QPoint endPoint(q->mapToGlobal(QPoint((q->width() - _calendarPickerContainer->width()) / 2, q->height() + 5)));
|
||||
QPropertyAnimation* showAnimation = new QPropertyAnimation(_calendarPickerContainer, "pos");
|
||||
QPoint endPoint(q->mapToGlobal(QPoint((q->width() - _calendarPickerContainer->width()) / 2, q->height() + 5)));
|
||||
QPropertyAnimation *showAnimation = new QPropertyAnimation(_calendarPickerContainer, "pos");
|
||||
showAnimation->setEasingCurve(QEasingCurve::OutCubic);
|
||||
showAnimation->setDuration(250);
|
||||
showAnimation->setStartValue(QPoint(endPoint.x(), endPoint.y() - 10));
|
||||
@@ -28,12 +22,10 @@ void ElaCalendarPickerPrivate::onCalendarPickerClicked()
|
||||
showAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
}
|
||||
|
||||
void ElaCalendarPickerPrivate::onCalendarSelectedDateChanged()
|
||||
{
|
||||
void ElaCalendarPickerPrivate::onCalendarSelectedDateChanged() {
|
||||
Q_Q(ElaCalendarPicker);
|
||||
Q_EMIT q->selectedDateChanged(_calendar->getSelectedDate());
|
||||
if (_calendarPickerContainer->isVisible())
|
||||
{
|
||||
if (_calendarPickerContainer->isVisible()) {
|
||||
_calendarPickerContainer->hide();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user