Initial commit

This commit is contained in:
user
2026-07-12 14:34:52 +04:00
commit 3abf6bd9c2
557 changed files with 68706 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#include "date_time_delegate.h"
DateTimeDelegate::DateTimeDelegate(QObject *parent)
: QStyledItemDelegate(parent) {}
QString DateTimeDelegate::displayText(const QVariant &value,
const QLocale &locale) const {
QDateTime datetime = QDateTime::fromString(value.toString(), Qt::ISODate);
if (!datetime.isValid()) {
return value.toString(); // Return raw value if parsing fails
}
QString formattedDateTime = locale.toString(datetime, QLocale::LongFormat);
if (!formattedDateTime.isEmpty()) {
// Capitalize the first letter of the formatted date string
formattedDateTime[0] = formattedDateTime[0].toUpper();
}
return formattedDateTime;
}
+17
View File
@@ -0,0 +1,17 @@
#ifndef DATE_TIME_DELEGATE_H
#define DATE_TIME_DELEGATE_H
#include <QDateTime>
#include <QStyledItemDelegate>
class DateTimeDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
explicit DateTimeDelegate(QObject *parent = nullptr);
QString displayText(const QVariant &value,
const QLocale &locale) const override;
};
#endif // DATE_TIME_DELEGATE_H