Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+31
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Renders complex types from model data to text for views
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Mike Wille, NLE, 2020-09-09
|
||||
*/
|
||||
|
||||
#include "data_delegate.h"
|
||||
|
||||
#include <ngltools/ngltools_dtg.h>
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
|
||||
namespace LtsDataView
|
||||
{
|
||||
DataDelegate::DataDelegate(QObject *parent)
|
||||
: QStyledItemDelegate(parent)
|
||||
{}
|
||||
|
||||
|
||||
QString DataDelegate::displayText(const QVariant &value, const QLocale &locale) const
|
||||
{
|
||||
if (value.type() == QVariant::Type::DateTime)
|
||||
return DTG::toString(value.toDateTime());
|
||||
return QStyledItemDelegate::displayText(value, locale);
|
||||
}
|
||||
} // namespace LtsDataView
|
||||
Reference in new issue
Block a user