Debugger: Make WatchDelegate less dependent on WatchView

Change-Id: I07c1c22d1dfa9323a2fed8938c4fe53d1a534e90
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-10-16 18:44:44 +02:00
parent 73158461b6
commit db1c21a3f8

View File

@@ -90,8 +90,8 @@ const char CurrentIndex[] = "CurrentIndex";
class WatchDelegate : public QItemDelegate class WatchDelegate : public QItemDelegate
{ {
public: public:
explicit WatchDelegate(WatchTreeView *parent) explicit WatchDelegate(QObject *parent)
: QItemDelegate(parent), m_watchWindow(parent) : QItemDelegate(parent)
{} {}
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &, QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &,
@@ -141,7 +141,7 @@ public:
return; return;
WatchHandler *handler = currentEngine()->watchHandler(); WatchHandler *handler = currentEngine()->watchHandler();
handler->removeData(index.data(LocalsINameRole).toByteArray()); handler->removeData(index.data(LocalsINameRole).toByteArray());
m_watchWindow->watchExpression(value); handler->watchExpression(value);
} }
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
@@ -149,9 +149,6 @@ public:
{ {
editor->setGeometry(option.rect); editor->setGeometry(option.rect);
} }
private:
WatchTreeView *m_watchWindow;
}; };
// Watch model query helpers. // Watch model query helpers.