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...

Qt Code:
  1. QString myDelegate::displayText(const QVariant &val, const QLocale &locale) const {
  2. if(val.type()==QVariant::Double) return locale.toString(val.toDouble(), 'g', 12); // or QString::number(val.toDouble(), 'g', 12)
  3. return QStyledItemDelegate::displayText(val, locale);
  4. }
To copy to clipboard, switch view to plain text mode