diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-27 07:40:36 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-27 07:40:36 (GMT) |
commit | 67eaf2cef1f9624c4a74164a18cd46f502419922 (patch) | |
tree | d25bf68ad7007e068f7cfd3aedd3e8f6188c6ad6 /tools/qmldebugger | |
parent | ec0a81544521eedc1bbd2d2e5133470bc8eaab0d (diff) | |
download | Qt-67eaf2cef1f9624c4a74164a18cd46f502419922.zip Qt-67eaf2cef1f9624c4a74164a18cd46f502419922.tar.gz Qt-67eaf2cef1f9624c4a74164a18cd46f502419922.tar.bz2 |
Show property type in separate column like Creator debugger.
Diffstat (limited to 'tools/qmldebugger')
-rw-r--r-- | tools/qmldebugger/standalone/objectpropertiesview.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/qmldebugger/standalone/objectpropertiesview.cpp b/tools/qmldebugger/standalone/objectpropertiesview.cpp index ae9e8be..f86a69e 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.cpp +++ b/tools/qmldebugger/standalone/objectpropertiesview.cpp @@ -2,6 +2,7 @@ #include <QtGui/qtreewidget.h> #include <QtGui/qlayout.h> +#include <QtGui/qheaderview.h> #include <QtDeclarative/qmldebugservice.h> #include <QtDeclarative/qmldebug.h> @@ -45,11 +46,13 @@ ObjectPropertiesView::ObjectPropertiesView(QmlEngineDebug *client, QWidget *pare m_tree = new QTreeWidget(this); m_tree->setAlternatingRowColors(true); m_tree->setExpandsOnDoubleClick(false); - m_tree->setHeaderLabels(QStringList() << tr("Property") << tr("Value")); + m_tree->setHeaderLabels(QStringList() + << tr("Name") << tr("Value") << tr("Type")); QObject::connect(m_tree, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(itemActivated(QTreeWidgetItem *))); - m_tree->setColumnCount(2); + m_tree->setColumnCount(3); + m_tree->header()->setDefaultSectionSize(150); layout->addWidget(m_tree); } @@ -130,11 +133,11 @@ void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) binding->setText(1, p.binding()); binding->setForeground(1, Qt::darkGreen); } + + item->setText(2, p.valueTypeName()); item->setExpanded(true); } - - m_tree->resizeColumnToContents(0); } void ObjectPropertiesView::watchCreated(QmlDebugWatch *watch) @@ -175,9 +178,7 @@ void ObjectPropertiesView::valueChanged(const QByteArray &name, const QVariant & PropertiesViewItem *item = static_cast<PropertiesViewItem *>(m_tree->topLevelItem(i)); if (item->property.name() == name) { if (value.isNull()) { - item->setText(1, QLatin1String("<null>") - + QLatin1String(" : ") - + item->property.valueTypeName()); + item->setText(1, QLatin1String("<null>")); } else { item->setText(1, value.toString()); } |