Hmm... I even told you which method to use to get the desired output... I really don't understand what is so hard there to understand...
if(val.
type()==QVariant::Double) return locale.
toString(val.
toDouble(),
'g',
12);
// or QString::number(val.toDouble(), 'g', 12) return QStyledItemDelegate::displayText(val, locale);
}
QString myDelegate::displayText(const QVariant &val, const QLocale &locale) const {
if(val.type()==QVariant::Double) return locale.toString(val.toDouble(), 'g', 12); // or QString::number(val.toDouble(), 'g', 12)
return QStyledItemDelegate::displayText(val, locale);
}
To copy to clipboard, switch view to plain text mode
Bookmarks