summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qstyleditemdelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qstyleditemdelegate.cpp')
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index 913af89..b5f676a 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -112,7 +112,7 @@ public:
data items from a model.
\ingroup model-view
- \mainclass
+
\since 4.4
When displaying data from models in Qt item views, e.g., a
@@ -267,9 +267,10 @@ QStyledItemDelegate::~QStyledItemDelegate()
QString QStyledItemDelegate::displayText(const QVariant &value, const QLocale& locale) const
{
QString text;
- switch (value.type()) {
+ switch (value.userType()) {
+ case QMetaType::Float:
case QVariant::Double:
- text = locale.toString(value.toDouble());
+ text = locale.toString(value.toReal());
break;
case QVariant::Int:
case QVariant::LongLong: