diff options
author | Bea Lam <bea.lam@nokia.com> | 2009-10-29 05:48:41 (GMT) |
---|---|---|
committer | Bea Lam <bea.lam@nokia.com> | 2009-10-29 05:48:41 (GMT) |
commit | 0355027fc68e7ceafe0ee1d439772b0b00656e09 (patch) | |
tree | 928f13b5493f59b54dc59c6857f03f612b7e5c4e | |
parent | 14a30e841243fa31dd8fe024000e703f1985ef31 (diff) | |
download | Qt-0355027fc68e7ceafe0ee1d439772b0b00656e09.zip Qt-0355027fc68e7ceafe0ee1d439772b0b00656e09.tar.gz Qt-0355027fc68e7ceafe0ee1d439772b0b00656e09.tar.bz2 |
Minor improvements
4 files changed, 9 insertions, 11 deletions
diff --git a/tools/qmldebugger/standalone/expressionquerywidget.cpp b/tools/qmldebugger/standalone/expressionquerywidget.cpp index e064189..a0d3df6 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.cpp +++ b/tools/qmldebugger/standalone/expressionquerywidget.cpp @@ -112,7 +112,7 @@ void ExpressionQueryWidget::showCurrentContext() m_textEdit->setTextColor(Qt::darkGreen); m_textEdit->append(m_currObject.className() + QLatin1String(": ") - + (m_currObject.name().isEmpty() ? QLatin1String("<unnamed>") : m_currObject.name())); + + (m_currObject.name().isEmpty() ? QLatin1String("<unnamed object>") : m_currObject.name())); appendPrompt(); } @@ -149,15 +149,12 @@ void ExpressionQueryWidget::showResult() QVariant value = m_query->result(); QString result; - if (value.isNull()) { + if (value.type() == QVariant::List || value.type() == QVariant::StringList) { + result = tr("<%1 items>", "%1 = number of items").arg(value.toList().count()); + } else if (value.isNull()) { result = QLatin1String("<no value>"); } else { - if (value.canConvert(QVariant::String)) { - result = value.toString(); - } else { - QDebug debug(&result); - debug << value; - } + result = value.toString(); } if (m_mode == SeparateEntryMode) { diff --git a/tools/qmldebugger/standalone/objectpropertiesview.cpp b/tools/qmldebugger/standalone/objectpropertiesview.cpp index d6fefa0..b8e10a3 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.cpp +++ b/tools/qmldebugger/standalone/objectpropertiesview.cpp @@ -141,7 +141,7 @@ void ObjectPropertiesView::setPropertyValue(PropertiesViewItem *item, const QVar item->setExpanded(false); } else { - item->setText(1, (value.isNull() ? QLatin1String("<null>") : value.toString())); + item->setText(1, (value.isNull() ? QLatin1String("<no value>") : value.toString())); item->setExpanded(true); } diff --git a/tools/qmldebugger/standalone/qmldebugger.cpp b/tools/qmldebugger/standalone/qmldebugger.cpp index 5882cb2..b91763d 100644 --- a/tools/qmldebugger/standalone/qmldebugger.cpp +++ b/tools/qmldebugger/standalone/qmldebugger.cpp @@ -17,7 +17,6 @@ QmlDebugger::QmlDebugger(QWidget *parent) QVBoxLayout *layout = new QVBoxLayout; setLayout(layout); - QHBoxLayout *connectLayout = new QHBoxLayout; layout->addLayout(connectLayout); connectLayout->addStretch(2); @@ -61,6 +60,8 @@ QmlDebugger::QmlDebugger(QWidget *parent) this, SLOT(connectionError(QAbstractSocket::SocketError))); m_tabs->setCurrentIndex(1); + + connectToHost(); } void QmlDebugger::setHost(const QString &host) diff --git a/tools/qmldebugger/standalone/watchtable.cpp b/tools/qmldebugger/standalone/watchtable.cpp index 19f034e..7483d28 100644 --- a/tools/qmldebugger/standalone/watchtable.cpp +++ b/tools/qmldebugger/standalone/watchtable.cpp @@ -217,7 +217,7 @@ void WatchTableModel::togglePropertyWatch(const QmlDebugObjectReference &object, + QLatin1String(" on\n") + object.className() + QLatin1String(":\n") - + (object.name().isEmpty() ? QLatin1String("<unnamed>") : object.name()); + + (object.name().isEmpty() ? QLatin1String("<unnamed object>") : object.name()); addWatch(watch, desc); emit watchCreated(watch); } |