MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / displayText

Method displayText

gui/datedelegate.cpp:32–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32QString DateDelegate::displayText(const QVariant &value, const QLocale &locale) const {
33 Q_UNUSED(locale); // suppress unused variable
34
35 if (value.toLongLong() == 0)
36 return "";
37 QDateTime timestamp;
38 timestamp.setTime_t(value.toLongLong()/1000);
39
40 //QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom));
41 if (timestamp.date() == QDate::currentDate())
42 return tr("Today") +" " + timestamp.time().toString(global.timeFormat);
43 return timestamp.toString(global.dateFormat + QString(" ") +global.timeFormat);
44// return timestamp.toString(Qt::SystemLocaleShortDate);
45}

Callers

nothing calls this directly

Calls 2

QStringClass · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected