diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-28 05:59:52 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-28 05:59:52 (GMT) |
commit | a168b0308b9977f01ae49b4c831d120df0dea951 (patch) | |
tree | 680327429eca354f28df48a42f3336c802e3fa27 | |
parent | 47af5a1e8ad73de2b18137c0414b794e9fc7001c (diff) | |
parent | 55a3fcd7b2fe9cd43f3c0c20d75aaef056a05c5b (diff) | |
download | Qt-a168b0308b9977f01ae49b4c831d120df0dea951.zip Qt-a168b0308b9977f01ae49b4c831d120df0dea951.tar.gz Qt-a168b0308b9977f01ae49b4c831d120df0dea951.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | src/declarative/debugger/qmldebug.cpp | 17 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug.cpp | 67 | ||||
-rw-r--r-- | src/declarative/qml/qmlenginedebug_p.h | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlwatcher.cpp | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlwatcher_p.h | 3 | ||||
-rw-r--r-- | tools/qmldebugger/creatorplugin/qmlinspectormode.cpp | 9 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/engine.cpp | 2 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/expressionquerywidget.cpp | 34 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/expressionquerywidget.h | 10 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/objectpropertiesview.cpp | 76 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/objectpropertiesview.h | 2 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/objecttree.cpp | 1 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/objecttree.h | 4 | ||||
-rw-r--r-- | tools/qmldebugger/standalone/watchtable.cpp | 3 |
14 files changed, 150 insertions, 84 deletions
diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index 2537ec0..5a8cda0 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -67,26 +67,30 @@ int QmlEngineDebugPrivate::getId() void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugEnginesQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->enginesQuery.remove(q->m_queryId); + if (p && q) + p->enginesQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugRootContextQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->rootContextQuery.remove(q->m_queryId); + if (p && q) + p->rootContextQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugObjectQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->objectQuery.remove(q->m_queryId); + if (p && q) + p->objectQuery.remove(q->m_queryId); } void QmlEngineDebugPrivate::remove(QmlEngineDebug *c, QmlDebugExpressionQuery *q) { QmlEngineDebugPrivate *p = (QmlEngineDebugPrivate *)QObjectPrivate::get(c); - p->expressionQuery.remove(q->m_queryId); + if (p && q) + p->expressionQuery.remove(q->m_queryId); } Q_DECLARE_METATYPE(QmlDebugObjectReference); @@ -118,9 +122,10 @@ void QmlEngineDebugPrivate::decode(QDataStream &ds, QmlDebugObjectReference &o, prop.m_binding = data.binding; prop.m_hasNotifySignal = data.hasNotifySignal; prop.m_valueTypeName = data.valueTypeName; - if (data.type == QmlEngineDebugServer::QmlObjectProperty::Basic) + if (data.type == QmlEngineDebugServer::QmlObjectProperty::Basic + || data.type == QmlEngineDebugServer::QmlObjectProperty::List) { prop.m_value = data.value; - else if (data.type == QmlEngineDebugServer::QmlObjectProperty::Object) { + } else if (data.type == QmlEngineDebugServer::QmlObjectProperty::Object) { QmlDebugObjectReference obj; obj.m_debugId = prop.m_value.toInt(); prop.m_value = qVariantFromValue(obj); diff --git a/src/declarative/qml/qmlenginedebug.cpp b/src/declarative/qml/qmlenginedebug.cpp index 664ca3f..63be6b0 100644 --- a/src/declarative/qml/qmlenginedebug.cpp +++ b/src/declarative/qml/qmlenginedebug.cpp @@ -57,8 +57,8 @@ QmlEngineDebugServer::QmlEngineDebugServer(QObject *parent) : QmlDebugService(QLatin1String("QmlEngine"), parent), m_watch(new QmlWatcher(this)) { - QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QByteArray,QVariant)), - this, SLOT(propertyChanged(int,int,QByteArray,QVariant))); + QObject::connect(m_watch, SIGNAL(propertyChanged(int,int,QMetaProperty,QVariant)), + this, SLOT(propertyChanged(int,int,QMetaProperty,QVariant))); } QDataStream &operator<<(QDataStream &ds, @@ -110,9 +110,11 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) if (binding) rv.binding = binding->expression(); + QVariant value = prop.read(obj); + rv.value = valueContents(value); + if (prop.type() < QVariant::UserType) { rv.type = QmlObjectProperty::Basic; - rv.value = prop.read(obj); } else if (QmlMetaType::isObject(prop.userType())) { rv.type = QmlObjectProperty::Object; } else if (QmlMetaType::isList(prop.userType()) || @@ -123,6 +125,32 @@ QmlEngineDebugServer::propertyData(QObject *obj, int propIdx) return rv; } +QVariant QmlEngineDebugServer::valueContents(const QVariant &value) const +{ + if (value.type() < QVariant::UserType) + return value; + + int userType = value.userType(); + + if (QmlMetaType::isList(userType) || QmlMetaType::isQmlList(userType)) { + int count = QmlMetaType::listCount(value); + QVariantList contents; + for (int i=0; i<count; i++) + contents << valueContents(QmlMetaType::listAt(value, i)); + return contents; + } else if (QmlMetaType::isObject(userType)) { + QObject *o = QmlMetaType::toQObject(value); + if (o) { + QString name = o->objectName(); + if (name.isEmpty()) + name = QLatin1String("<unnamed>"); + return name; + } + } + + return QLatin1String("<unknown value>"); +} + void QmlEngineDebugServer::buildObjectDump(QDataStream &message, QObject *object, bool recur) { @@ -188,32 +216,6 @@ void QmlEngineDebugServer::buildObjectList(QDataStream &message, } } -QVariant QmlEngineDebugServer::serializableVariant(const QVariant &value) -{ - if (value.type() < QVariant::UserType) - return value; - - if (!value.toString().isEmpty()) - return value.toString(); - - QVariant v; - if (value.type() == QVariant::UserType || QmlMetaType::isObject(value.userType())) { - QObject *o = QmlMetaType::toQObject(value); - if (o) { - QString objectName = o->objectName(); - if (objectName.isEmpty()) - objectName = QLatin1String("<unnamed>"); - v = QString::fromUtf8(o->metaObject()->className()) + - QLatin1String(": ") + objectName; - } - } - - if (v.isNull()) - v = QString::fromUtf8(value.typeName()); - - return v; -} - QmlEngineDebugServer::QmlObjectData QmlEngineDebugServer::objectData(QObject *object) { @@ -357,7 +359,7 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) if (undefined) result = QLatin1String("<undefined>"); else - result = serializableVariant(value); + result = valueContents(value); delete exprObj; } else { result = QLatin1String("<unknown context>"); @@ -371,13 +373,12 @@ void QmlEngineDebugServer::messageReceived(const QByteArray &message) } } -void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value) +void QmlEngineDebugServer::propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value) { QByteArray reply; - QVariant v = serializableVariant(value); QDataStream rs(&reply, QIODevice::WriteOnly); - rs << QByteArray("UPDATE_WATCH") << id << objectId << property << v; + rs << QByteArray("UPDATE_WATCH") << id << objectId << QString::fromUtf8(property.name()) << valueContents(value); sendMessage(reply); } diff --git a/src/declarative/qml/qmlenginedebug_p.h b/src/declarative/qml/qmlenginedebug_p.h index 075a711..a8572eb 100644 --- a/src/declarative/qml/qmlenginedebug_p.h +++ b/src/declarative/qml/qmlenginedebug_p.h @@ -97,14 +97,14 @@ protected: virtual void messageReceived(const QByteArray &); private Q_SLOTS: - void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: void buildObjectList(QDataStream &, QmlContext *); void buildObjectDump(QDataStream &, QObject *, bool); QmlObjectData objectData(QObject *); QmlObjectProperty propertyData(QObject *, int); - QVariant serializableVariant(const QVariant &value); + QVariant valueContents(const QVariant &defaultValue) const; static QList<QmlEngine *> m_engines; QmlWatcher *m_watch; diff --git a/src/declarative/qml/qmlwatcher.cpp b/src/declarative/qml/qmlwatcher.cpp index ca99472..8cd51e0 100644 --- a/src/declarative/qml/qmlwatcher.cpp +++ b/src/declarative/qml/qmlwatcher.cpp @@ -112,7 +112,7 @@ void QmlWatchProxy::notifyValueChanged() else v = m_property.read(m_object); - emit m_watch->propertyChanged(m_id, m_debugId, QByteArray(m_property.name()), v); + emit m_watch->propertyChanged(m_id, m_debugId, m_property, v); } diff --git a/src/declarative/qml/qmlwatcher_p.h b/src/declarative/qml/qmlwatcher_p.h index 99cae88..0bfcd71 100644 --- a/src/declarative/qml/qmlwatcher_p.h +++ b/src/declarative/qml/qmlwatcher_p.h @@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE class QmlWatchProxy; class QmlExpression; class QmlContext; +class QMetaProperty; class QmlWatcher : public QObject { @@ -79,7 +80,7 @@ public: void removeWatch(int id); Q_SIGNALS: - void propertyChanged(int id, int objectId, const QByteArray &property, const QVariant &value); + void propertyChanged(int id, int objectId, const QMetaProperty &property, const QVariant &value); private: friend class QmlWatchProxy; diff --git a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp index aec661c..a90ca2c 100644 --- a/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp +++ b/tools/qmldebugger/creatorplugin/qmlinspectormode.cpp @@ -168,10 +168,17 @@ void QmlInspectorMode::connectionStateChanged() switch (m_conn->state()) { default: case QAbstractSocket::UnconnectedState: + { emit statusMessage(tr("[Inspector] disconnected.\n\n")); m_addressEdit->setEnabled(true); m_portSpinBox->setEnabled(true); + + delete m_engineQuery; + m_engineQuery = 0; + delete m_contextQuery; + m_contextQuery = 0; break; + } case QAbstractSocket::HostLookupState: emit statusMessage(tr("[Inspector] resolving host...")); break; @@ -378,7 +385,7 @@ void QmlInspectorMode::initWidgets() m_propertiesWidget = new ObjectPropertiesView; m_watchTableView = new WatchTableView(m_watchTableModel); m_frameRateWidget = new CanvasFrameRate; - m_expressionWidget = new ExpressionQueryWidget; + m_expressionWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode); // FancyMainWindow uses widgets' window titles for tab labels m_objectTreeWidget->setWindowTitle(tr("Object Tree")); diff --git a/tools/qmldebugger/standalone/engine.cpp b/tools/qmldebugger/standalone/engine.cpp index a1fd009..f1eada8 100644 --- a/tools/qmldebugger/standalone/engine.cpp +++ b/tools/qmldebugger/standalone/engine.cpp @@ -86,7 +86,7 @@ EnginePane::EnginePane(QmlDebugConnection *conn, QWidget *parent) connect(m_watchTableView, SIGNAL(objectActivated(int)), m_objTree, SLOT(setCurrentObject(int))); - m_exprQueryWidget = new ExpressionQueryWidget(m_client); + m_exprQueryWidget = new ExpressionQueryWidget(ExpressionQueryWidget::SeparateEntryMode, m_client); connect(m_objTree, SIGNAL(currentObjectChanged(QmlDebugObjectReference)), m_exprQueryWidget, SLOT(setCurrentObject(QmlDebugObjectReference))); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.cpp b/tools/qmldebugger/standalone/expressionquerywidget.cpp index f8f5aef..3c4296d 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.cpp +++ b/tools/qmldebugger/standalone/expressionquerywidget.cpp @@ -11,9 +11,9 @@ #include "expressionquerywidget.h" -ExpressionQueryWidget::ExpressionQueryWidget(QmlEngineDebug *client, QWidget *parent) +ExpressionQueryWidget::ExpressionQueryWidget(Mode mode, QmlEngineDebug *client, QWidget *parent) : QWidget(parent), - m_style(Compact), + m_mode(mode), m_client(client), m_query(0), m_textEdit(new QTextEdit), @@ -28,7 +28,7 @@ ExpressionQueryWidget::ExpressionQueryWidget(QmlEngineDebug *client, QWidget *pa updateTitle(); - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_lineEdit = new QLineEdit; connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(executeExpression())); QHBoxLayout *hbox = new QHBoxLayout; @@ -53,7 +53,8 @@ void ExpressionQueryWidget::setEngineDebug(QmlEngineDebug *client) void ExpressionQueryWidget::clear() { m_textEdit->clear(); - m_lineEdit->clear(); + if (m_lineEdit) + m_lineEdit->clear(); } void ExpressionQueryWidget::updateTitle() @@ -73,7 +74,7 @@ void ExpressionQueryWidget::appendPrompt() { m_textEdit->moveCursor(QTextCursor::End); - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_textEdit->insertPlainText("\n"); } else { m_textEdit->setTextColor(Qt::gray); @@ -111,7 +112,7 @@ void ExpressionQueryWidget::executeExpression() if (!m_client) return; - if (m_style == Compact) + if (m_mode == SeparateEntryMode) m_expr = m_lineEdit->text().trimmed(); else m_expr = m_expr.trimmed(); @@ -136,20 +137,31 @@ void ExpressionQueryWidget::showResult() { if (m_query) { m_textEdit->moveCursor(QTextCursor::End); + QVariant value = m_query->result(); QString result; - if (m_query->result().isNull()) + + if (value.isNull()) { result = QLatin1String("<no value>"); - else - result = m_query->result().toString(); + } else { + if (value.canConvert(QVariant::String)) { + result = value.toString(); + } else { + QDebug debug(&result); + debug << value; + } + } - if (m_style == Compact) { + if (m_mode == SeparateEntryMode) { m_textEdit->setTextColor(Qt::black); m_textEdit->setFontWeight(QFont::Bold); m_textEdit->insertPlainText(m_expr + " : "); m_textEdit->setFontWeight(QFont::Normal); m_textEdit->insertPlainText(result); } else { - m_textEdit->append(result); + m_textEdit->setTextColor(Qt::darkGreen); + m_textEdit->insertPlainText(" => "); + m_textEdit->setTextColor(Qt::black); + m_textEdit->insertPlainText(result); } appendPrompt(); m_expr.clear(); diff --git a/tools/qmldebugger/standalone/expressionquerywidget.h b/tools/qmldebugger/standalone/expressionquerywidget.h index 6fab059..3fe0295 100644 --- a/tools/qmldebugger/standalone/expressionquerywidget.h +++ b/tools/qmldebugger/standalone/expressionquerywidget.h @@ -16,12 +16,12 @@ class ExpressionQueryWidget : public QWidget { Q_OBJECT public: - enum Style { - Compact, - Shell + enum Mode { + SeparateEntryMode, + ShellMode }; - ExpressionQueryWidget(QmlEngineDebug *client = 0, QWidget *parent = 0); + ExpressionQueryWidget(Mode mode = SeparateEntryMode, QmlEngineDebug *client = 0, QWidget *parent = 0); void setEngineDebug(QmlEngineDebug *client); void clear(); @@ -42,7 +42,7 @@ private: void showCurrentContext(); void updateTitle(); - Style m_style; + Mode m_mode; QmlEngineDebug *m_client; QmlDebugExpressionQuery *m_query; diff --git a/tools/qmldebugger/standalone/objectpropertiesview.cpp b/tools/qmldebugger/standalone/objectpropertiesview.cpp index f86a69e..d6fefa0 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.cpp +++ b/tools/qmldebugger/standalone/objectpropertiesview.cpp @@ -16,19 +16,25 @@ class PropertiesViewItem : public QObject, public QTreeWidgetItem { Q_OBJECT public: - PropertiesViewItem(QTreeWidget *widget); - PropertiesViewItem(QTreeWidgetItem *parent); + enum Type { + BindingType, + OtherType + }; + + PropertiesViewItem(QTreeWidget *widget, Type type = OtherType); + PropertiesViewItem(QTreeWidgetItem *parent, Type type = OtherType); QmlDebugPropertyReference property; + Type type; }; -PropertiesViewItem::PropertiesViewItem(QTreeWidget *widget) - : QTreeWidgetItem(widget) +PropertiesViewItem::PropertiesViewItem(QTreeWidget *widget, Type type) + : QTreeWidgetItem(widget), type(type) { } -PropertiesViewItem::PropertiesViewItem(QTreeWidgetItem *parent) - : QTreeWidgetItem(parent) +PropertiesViewItem::PropertiesViewItem(QTreeWidgetItem *parent, Type type) + : QTreeWidgetItem(parent), type(type) { } @@ -109,6 +115,42 @@ void ObjectPropertiesView::queryFinished() setObject(obj); } +void ObjectPropertiesView::setPropertyValue(PropertiesViewItem *item, const QVariant &value, bool makeGray) +{ + if (value.type() == QVariant::List || value.type() == QVariant::StringList) { + PropertiesViewItem *bindingItem = static_cast<PropertiesViewItem*>(item->takeChild(item->childCount() - 1)); + if (bindingItem && bindingItem->type != PropertiesViewItem::BindingType) { + delete bindingItem; + bindingItem = 0; + } + + qDeleteAll(item->takeChildren()); + + QVariantList variants = value.toList(); + item->setText(1, tr("<%1 items>", "%1 = number of items").arg(variants.count())); + item->setText(2, QString::fromUtf8(value.typeName())); + + PropertiesViewItem *child; + for (int i=0; i<variants.count(); i++) { + child = new PropertiesViewItem(item); + setPropertyValue(child, variants[i], makeGray); + } + + if (bindingItem) + item->addChild(bindingItem); + + item->setExpanded(false); + } else { + item->setText(1, (value.isNull() ? QLatin1String("<null>") : value.toString())); + item->setExpanded(true); + } + + if (makeGray) { + for (int i=0; i<m_tree->columnCount(); i++) + item->setForeground(i, Qt::gray); + } +} + void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) { m_object = object; @@ -123,20 +165,17 @@ void ObjectPropertiesView::setObject(const QmlDebugObjectReference &object) item->setText(0, p.name()); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); - if (!p.hasNotifySignal()) { - item->setForeground(0, Qt::gray); - item->setForeground(1, Qt::gray); - } + + setPropertyValue(item, p.value(), !p.hasNotifySignal()); + item->setText(2, p.valueTypeName()); + // binding is set after property value to ensure it is added to the end of the + // list, if the value is a list if (!p.binding().isEmpty()) { - PropertiesViewItem *binding = new PropertiesViewItem(item); + PropertiesViewItem *binding = new PropertiesViewItem(item, PropertiesViewItem::BindingType); binding->setText(1, p.binding()); binding->setForeground(1, Qt::darkGreen); } - - item->setText(2, p.valueTypeName()); - - item->setExpanded(true); } } @@ -177,11 +216,8 @@ 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) { - if (value.isNull()) { - item->setText(1, QLatin1String("<null>")); - } else { - item->setText(1, value.toString()); - } + setPropertyValue(item, value, !item->property.hasNotifySignal()); + return; } } } diff --git a/tools/qmldebugger/standalone/objectpropertiesview.h b/tools/qmldebugger/standalone/objectpropertiesview.h index 6a1fc03..306e5b9 100644 --- a/tools/qmldebugger/standalone/objectpropertiesview.h +++ b/tools/qmldebugger/standalone/objectpropertiesview.h @@ -10,6 +10,7 @@ QT_BEGIN_NAMESPACE class QTreeWidget; class QTreeWidgetItem; class QmlDebugConnection; +class PropertiesViewItem; class ObjectPropertiesView : public QWidget { @@ -36,6 +37,7 @@ private slots: private: void setObject(const QmlDebugObjectReference &object); void setWatched(const QString &property, bool watched); + void setPropertyValue(PropertiesViewItem *item, const QVariant &value, bool makeGray); QmlEngineDebug *m_client; QmlDebugObjectQuery *m_query; diff --git a/tools/qmldebugger/standalone/objecttree.cpp b/tools/qmldebugger/standalone/objecttree.cpp index 4059e77..6c132b6 100644 --- a/tools/qmldebugger/standalone/objecttree.cpp +++ b/tools/qmldebugger/standalone/objecttree.cpp @@ -61,6 +61,7 @@ void ObjectTree::objectFetched() { dump(m_query->object(), 0); buildTree(m_query->object(), 0); + setCurrentItem(topLevelItem(0)); delete m_query; m_query = 0; diff --git a/tools/qmldebugger/standalone/objecttree.h b/tools/qmldebugger/standalone/objecttree.h index 95820f3..ba2e78f 100644 --- a/tools/qmldebugger/standalone/objecttree.h +++ b/tools/qmldebugger/standalone/objecttree.h @@ -27,8 +27,8 @@ signals: void expressionWatchRequested(const QmlDebugObjectReference &, const QString &); public slots: - void reload(int objectDebugId); - void setCurrentObject(int debugId); + void reload(int objectDebugId); // set the root object + void setCurrentObject(int debugId); // select an object in the tree protected: virtual void mousePressEvent(QMouseEvent *); diff --git a/tools/qmldebugger/standalone/watchtable.cpp b/tools/qmldebugger/standalone/watchtable.cpp index a7fd052..19f034e 100644 --- a/tools/qmldebugger/standalone/watchtable.cpp +++ b/tools/qmldebugger/standalone/watchtable.cpp @@ -265,7 +265,8 @@ void WatchTableModel::removeAllWatches() for (int i=0; i<m_columns.count(); i++) { if (m_client) m_client->removeWatch(m_columns[i].watch); - delete m_columns[i].watch; + else + delete m_columns[i].watch; } m_columns.clear(); m_values.clear(); |