Hi,
I have subclassed QStyledItemDelegate and override the displayText() as you propose and it works.
Thanks again
// replace the date 01/01/3000 by "permanent"
#include "permanentdelegate.h"
{
if (value.
toDate() == QDate(3000,
1,
1)) { return QStyledItemDelegate::displayText("permanent", locale);
}
else
return QStyledItemDelegate::displayText(value, locale);
}
// replace the date 01/01/3000 by "permanent"
#include "permanentdelegate.h"
QString PermanentDelegate::displayText(const QVariant &value, const QLocale &locale) const
{
if (value.toDate() == QDate(3000,1,1)) {
return QStyledItemDelegate::displayText("permanent", locale);
}
else
return QStyledItemDelegate::displayText(value, locale);
}
To copy to clipboard, switch view to plain text mode
Bookmarks