Commit c1c1221a authored by hjk's avatar hjk
Browse files

Debugger: Make WatchItem accessible to engines



Change-Id: I1586a4c4f11cc4d622a6e164875f5b6ee2e1eb18
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 8b5dcc13
......@@ -114,54 +114,6 @@ static QByteArray stripForFormat(const QByteArray &ba)
return res;
}
////////////////////////////////////////////////////////////////////
//
// WatchItem
//
////////////////////////////////////////////////////////////////////
class WatchItem : public TreeItem
{
public:
WatchItem() : fetchTriggered(false) {}
WatchItem(const QByteArray &i, const QString &n)
{
fetchTriggered = false;
d.iname = i;
d.name = n;
}
WatchItem *parentItem() const { return dynamic_cast<WatchItem *>(parent()); }
const WatchModel *watchModel() const;
WatchModel *watchModel();
QVariant data(int column, int role) const;
Qt::ItemFlags flags(int column) const;
bool canFetchMore() const;
void fetchMore();
QString displayName() const;
QString displayType() const;
QString displayValue() const;
QString formattedValue() const;
QString expression() const;
int itemFormat() const;
QVariant editValue() const;
int editType() const;
void formatRequests(QByteArray *out) const;
void showInEditorHelper(QString *contents, int depth) const;
WatchItem *findItem(const QByteArray &iname);
public:
WatchData d;
bool fetchTriggered;
};
///////////////////////////////////////////////////////////////////////
//
// SeparatedView
......@@ -1891,6 +1843,33 @@ TypeFormatItem TypeFormatList::find(int format) const
return TypeFormatItem();
}
////////////////////////////////////////////////////////////////////
//
// WatchItem
//
////////////////////////////////////////////////////////////////////
WatchItem::WatchItem()
: fetchTriggered(false)
{}
WatchItem::WatchItem(const QByteArray &i, const QString &n)
{
fetchTriggered = false;
d.iname = i;
d.name = n;
}
WatchItem::WatchItem(const WatchData &data)
: d(data), fetchTriggered(false)
{
}
WatchItem *WatchItem::parentItem() const
{
return dynamic_cast<WatchItem *>(parent());
}
const WatchModel *WatchItem::watchModel() const
{
return static_cast<const WatchModel *>(model());
......
......@@ -44,6 +44,43 @@ namespace Internal {
class SeparatedView;
class WatchModel;
class WatchItem : public Utils::TreeItem
{
public:
WatchItem();
WatchItem(const QByteArray &i, const QString &n);
explicit WatchItem(const WatchData &data);
WatchItem *parentItem() const;
const WatchModel *watchModel() const;
WatchModel *watchModel();
QVariant data(int column, int role) const;
Qt::ItemFlags flags(int column) const;
bool canFetchMore() const;
void fetchMore();
QString displayName() const;
QString displayType() const;
QString displayValue() const;
QString formattedValue() const;
QString expression() const;
int itemFormat() const;
QVariant editValue() const;
int editType() const;
void formatRequests(QByteArray *out) const;
void showInEditorHelper(QString *contents, int depth) const;
WatchItem *findItem(const QByteArray &iname);
public:
WatchData d;
bool fetchTriggered;
};
// Special formats. Keep in sync with dumper.py.
enum DisplayFormat
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment