Use a custom item delegate applied to the date column of the view. Something like:
class DateDelegate: public QStyledItemDelegate {
Q_OBJECT
public:
return value.toDate().toString("...");
}
return QStyledItemDelegate::displayText(value, locale);
}
};
class DateDelegate: public QStyledItemDelegate {
Q_OBJECT
public:
QString displayText(const QVariant &value, const QLocale &locale) const {
if (value.type() == QVariant::Date) {
return value.toDate().toString("...");
}
return QStyledItemDelegate::displayText(value, locale);
}
};
To copy to clipboard, switch view to plain text mode
and QTableView::setItemDelegateForColumn()
Bookmarks