diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-15 00:13:55 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-15 00:13:55 (GMT) |
commit | fb5d5ce1cd1e2714343c3e26338601aa5dd79a54 (patch) | |
tree | 535d19204e917e4ef82b8f11ce2e516828c62ea4 /tools/qmldebugger | |
parent | a02233bb18706569fb78ccfaa1f6c05d5523bc3d (diff) | |
download | Qt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.zip Qt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.tar.gz Qt-fb5d5ce1cd1e2714343c3e26338601aa5dd79a54.tar.bz2 |
Give more information about the value of a property when the variant
toString() is empty.
Diffstat (limited to 'tools/qmldebugger')
-rw-r--r-- | tools/qmldebugger/objectpropertiesview.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/qmldebugger/objectpropertiesview.cpp b/tools/qmldebugger/objectpropertiesview.cpp index f725194..864468c 100644 --- a/tools/qmldebugger/objectpropertiesview.cpp +++ b/tools/qmldebugger/objectpropertiesview.cpp @@ -109,7 +109,7 @@ void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) item->setText(0, p.name()); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); if (!p.hasNotifySignal()) - item->setForeground(0, Qt::lightGray); + item->setForeground(0, Qt::gray); if (!p.binding().isEmpty()) { PropertiesViewItem *binding = new PropertiesViewItem(item); @@ -159,8 +159,18 @@ void ObjectPropertiesView::valueChanged(const QByteArray &name, const QVariant & { for (int i=0; i<m_tree->topLevelItemCount(); i++) { PropertiesViewItem *item = static_cast<PropertiesViewItem *>(m_tree->topLevelItem(i)); - if (item->property.name() == name) - item->setText(1, value.toString()); + if (item->property.name() == name) { + if (value.isNull()) { + item->setText(1, QLatin1String("null")); + item->setForeground(1, Qt::gray); + } else { + QString s = value.toString(); + if (s.isEmpty()) + s = QString::fromUtf8(value.typeName()); + item->setText(1, s); + item->setForeground(1, QBrush()); + } + } } } |