WrappingDateTimeEdit: Allow years to be stepped through.

pull/2052/head
srcejon 2024-03-20 14:32:11 +00:00
rodzic 68b833ad97
commit 05fe7b8393
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -29,7 +29,11 @@ WrappingDateTimeEdit::WrappingDateTimeEdit(QWidget *parent) :
void WrappingDateTimeEdit::stepBy(int steps) void WrappingDateTimeEdit::stepBy(int steps)
{ {
if (currentSection() == QDateTimeEdit::MonthSection) if (currentSection() == QDateTimeEdit::YearSection)
{
clipAndSetDate(date().addYears(steps));
}
else if (currentSection() == QDateTimeEdit::MonthSection)
{ {
clipAndSetDate(date().addMonths(steps)); clipAndSetDate(date().addMonths(steps));
} }