From 67eaf2cef1f9624c4a74164a18cd46f502419922 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 27 Oct 2009 17:40:36 +1000 Subject: Show property type in separate column like Creator debugger. --- tools/qmldebugger/standalone/objectpropertiesview.cpp | 15 ++++++++------- 1 file 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 #include +#include #include #include @@ -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(m_tree->topLevelItem(i)); if (item->property.name() == name) { if (value.isNull()) { - item->setText(1, QLatin1String("") - + QLatin1String(" : ") - + item->property.valueTypeName()); + item->setText(1, QLatin1String("")); } else { item->setText(1, value.toString()); } -- cgit v0.12