do not save a const reference to the user data in the info dialog

This commit is contained in:
ebbit1q 2026-06-06 02:15:34 +02:00
parent c14a008080
commit 1a2a9229d9
5 changed files with 27 additions and 34 deletions

View file

@ -0,0 +1,8 @@
#include <QDateTime>
inline static QPair<int, int> getDaysAndYearsBetween(const QDate &then, const QDate &now)
{
int years = now.addDays(1 - then.dayOfYear()).year() - then.year(); // there is no yearsTo
int days = then.addYears(years).daysTo(now);
return {days, years};
}