feat: Improve date picker, add select item loop logic

This commit is contained in:
kradchen
2024-09-18 13:06:25 +08:00
parent df7342625e
commit 3f0f05f397
3 changed files with 232 additions and 81 deletions

View File

@@ -13,11 +13,15 @@ DateSlidePickerBox::DateSlidePickerBox(QWidget *parent)
initBox(mHundredYearBox, {"19", "20"}, 56);
QStringList tenYearValues{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
mTenYearBox->setLoop(true);
mYearBox->setLoop(true);
initBox(mTenYearBox, tenYearValues);
initBox(mYearBox, tenYearValues);
addSplitLabel();
mMonthBox->setLoop(true);
QStringList monthValues{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"};
initBox(mMonthBox, monthValues, 56);
@@ -27,6 +31,7 @@ DateSlidePickerBox::DateSlidePickerBox(QWidget *parent)
for (int i = 13; i <= 31; i++) {
days << QString("%1").arg(i, 2);
}
mDayBox->setLoop(true);
initBox(mDayBox, days, 56);
mBigMonthList.append({"01", "03", "05", "07", "08", "10", "12"});