Refactor DateSlidePickerBox.

This commit is contained in:
Krad
2022-06-07 15:18:33 +08:00
parent 2892e4e181
commit 5c218f6ca3
2 changed files with 87 additions and 105 deletions

View File

@@ -8,26 +8,32 @@
#include <QWidget>
#include "SlidePickerBox.h"
#include <QDate>
class QHBoxLayout;
class DateSlidePickerBox:public QWidget {
Q_OBJECT
public:
explicit DateSlidePickerBox(QWidget *parent = nullptr);
QString getSelectedValue();
QString getSelectedValue() const;
void setSelectedValue(const QString& val);
void resizeLabel();
SlidePickerBox* myear;
SlidePickerBox* tyear;
SlidePickerBox* year;
SlidePickerBox* month;
SlidePickerBox* day;
public Q_SLOTS:
void leapYearAndFebruaryAdjust();
private:
int getYear();
QStringList bigMonth;
bool isBigMonth();
QHBoxLayout* layout;
QStringList mBigMonthList;
bool isBigMonth() const;
QHBoxLayout* mLayout;
SlidePickerBox* mHundredYearBox;
SlidePickerBox* mTenYearBox;
SlidePickerBox* mYearBox;
SlidePickerBox* mMonthBox;
SlidePickerBox* mDayBox;
void initBox(SlidePickerBox* aBox, const QStringList& aItemsValues, int width = 50);
void addSplitLabel();
};