Qt 4.8
Classes | Functions
qscriptdebuggerlocalsmodel.cpp File Reference
#include "qscriptdebuggerlocalsmodel_p.h"
#include "qscriptdebuggercommandschedulerjob_p.h"
#include "qscriptdebuggervalue_p.h"
#include "qscriptdebuggerresponse_p.h"
#include "qscriptdebuggerevent_p.h"
#include "qscriptdebuggervalueproperty_p.h"
#include "qscriptdebuggercommandschedulerinterface_p.h"
#include "qscriptdebuggercommandschedulerfrontend_p.h"
#include "qscriptdebuggerjobschedulerinterface_p.h"
#include "qscriptdebuggerobjectsnapshotdelta_p.h"
#include "private/qabstractitemmodel_p.h"
#include <QtCore/qdebug.h>
#include <QtCore/qcoreapplication.h>
#include <QtCore/qpointer.h>
#include <QtGui/qbrush.h>
#include <QtGui/qfont.h>

Go to the source code of this file.

Classes

struct  QScriptDebuggerLocalsModelNode
 
class  QScriptDebuggerLocalsModelPrivate
 

Functions

static QList< qint64findSnapshotIdsRecursively (QScriptDebuggerLocalsModelNode *root)
 

Function Documentation

◆ findSnapshotIdsRecursively()

static QList<qint64> findSnapshotIdsRecursively ( QScriptDebuggerLocalsModelNode root)
static

Definition at line 165 of file qscriptdebuggerlocalsmodel.cpp.

Referenced by QScriptDebuggerLocalsModelPrivate::deleteAllObjectSnapshots(), QScriptDebuggerLocalsModelPrivate::depopulate(), and QScriptDebuggerLocalsModelPrivate::removeChild().

166 {
167  QList<qint64> result;
168  if (root->snapshotId == -1) {
169  Q_ASSERT(root->children.isEmpty());
170  return result;
171  }
173  nodeStack.append(root);
174  while (!nodeStack.isEmpty()) {
175  QScriptDebuggerLocalsModelNode *node = nodeStack.takeFirst();
176  result.append(node->snapshotId);
177  for (int i = 0; i < node->children.count(); ++i) {
178  QScriptDebuggerLocalsModelNode *child = node->children.at(i);
179  if (child->snapshotId != -1)
180  nodeStack.prepend(child);
181  }
182  }
183  return result;
184 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
T takeFirst()
Removes the first item in the list and returns it.
Definition: qlist.h:489
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QScriptDebuggerLocalsModelNode * > children