Qt 4.8
Signals | Public Functions | List of all members
QScriptDebuggerLocalsModel Class Reference

#include <qscriptdebuggerlocalsmodel_p.h>

Inheritance diagram for QScriptDebuggerLocalsModel:
QAbstractItemModel QObject

Signals

void scopeObjectAvailable (const QModelIndex &index)
 
- Signals inherited from QAbstractItemModel
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 This signal is emitted just before columns are inserted into the model. More...
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 This signal is emitted just before columns are moved within the model. More...
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 This signal is emitted just before columns are removed from the model. More...
 
void columnsInserted (const QModelIndex &parent, int first, int last)
 This signal is emitted after columns have been inserted into the model. More...
 
void columnsMoved (const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column)
 This signal is emitted after columns have been moved within the model. More...
 
void columnsRemoved (const QModelIndex &parent, int first, int last)
 This signal is emitted after columns have been removed from the model. More...
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 This signal is emitted whenever the data in an existing item changes. More...
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 This signal is emitted whenever a header is changed. More...
 
void layoutAboutToBeChanged ()
 This signal is emitted just before the layout of a model is changed. More...
 
void layoutChanged ()
 This signal is emitted whenever the layout of items exposed by the model has changed; for example, when the model has been sorted. More...
 
void modelAboutToBeReset ()
 This signal is emitted when reset() is called, before the model's internal state (e. More...
 
void modelReset ()
 This signal is emitted when reset() is called, after the model's internal state (e. More...
 
void rowsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 This signal is emitted just before rows are inserted into the model. More...
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 This signal is emitted just before rows are moved within the model. More...
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 This signal is emitted just before rows are removed from the model. More...
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 This signal is emitted after rows have been inserted into the model. More...
 
void rowsMoved (const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
 This signal is emitted after rows have been moved within the model. More...
 
void rowsRemoved (const QModelIndex &parent, int first, int last)
 This signal is emitted after rows have been removed from the model. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

bool canFetchMore (const QModelIndex &parent) const
 Reimplemented Function More...
 
int columnCount (const QModelIndex &parent) const
 Reimplemented Function More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Reimplemented Function More...
 
void fetchMore (const QModelIndex &parent)
 Reimplemented Function More...
 
Qt::ItemFlags flags (const QModelIndex &index) const
 Reimplemented Function More...
 
int frameIndex () const
 
bool hasChildren (const QModelIndex &parent) const
 Reimplemented Function More...
 
QVariant headerData (int section, Qt::Orientation, int role=Qt::DisplayRole) const
 Reimplemented Function More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 Reimplemented Function More...
 
void init (int frameIndex)
 
QModelIndex parent (const QModelIndex &child) const
 Reimplemented Function More...
 
 QScriptDebuggerLocalsModel (QScriptDebuggerJobSchedulerInterface *jobScheduler, QScriptDebuggerCommandSchedulerInterface *commandScheduler, QObject *parent=0)
 
int rowCount (const QModelIndex &parent) const
 Reimplemented Function More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 Reimplemented Function More...
 
void sync (int frameIndex)
 
 ~QScriptDebuggerLocalsModel ()
 
- Public Functions inherited from QAbstractItemModel
virtual QModelIndex buddy (const QModelIndex &index) const
 Returns a model index for the buddy of the item represented by index. More...
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 Handles the data supplied by a drag and drop operation that ended with the given action. More...
 
bool hasIndex (int row, int column, const QModelIndex &parent=QModelIndex()) const
 Returns true if the model returns a valid QModelIndex for row and column with parent, otherwise returns false. More...
 
bool insertColumn (int column, const QModelIndex &parent=QModelIndex())
 Inserts a single column before the given column in the child items of the parent specified. More...
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 On models that support this, inserts count new columns into the model before the given column. More...
 
bool insertRow (int row, const QModelIndex &parent=QModelIndex())
 Inserts a single row before the given row in the child items of the parent specified. More...
 
virtual bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex())
 On models that support this, inserts count rows into the model before the given row. More...
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 Returns a map with values for all predefined roles in the model for the item at the given index. More...
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
 Returns a list of indexes for the items in the column of the start index where data stored under the given role matches the specified value. More...
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 Returns an object that contains serialized items of data corresponding to the list of indexes specified. More...
 
virtual QStringList mimeTypes () const
 Returns a list of MIME types that can be used to describe a list of model indexes. More...
 
 QAbstractItemModel (QObject *parent=0)
 Constructs an abstract item model with the given parent. More...
 
bool removeColumn (int column, const QModelIndex &parent=QModelIndex())
 Removes the given column from the child items of the parent specified. More...
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent=QModelIndex())
 On models that support this, removes count columns starting with the given column under parent parent from the model. More...
 
bool removeRow (int row, const QModelIndex &parent=QModelIndex())
 Removes the given row from the child items of the parent specified. More...
 
virtual bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex())
 On models that support this, removes count rows starting with the given row under parent parent from the model. More...
 
const QHash< int, QByteArray > & roleNames () const
 Returns the model's role names. More...
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
 Sets the data for the given role and section in the header with the specified orientation to the value supplied. More...
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 Sets the role data for the item at index to the associated value in roles, for every Qt::ItemDataRole. More...
 
void setSupportedDragActions (Qt::DropActions)
 Sets the supported drag actions for the items in the model. More...
 
QModelIndex sibling (int row, int column, const QModelIndex &idx) const
 Returns the sibling at row and column for the item at index, or an invalid QModelIndex if there is no sibling at that location. More...
 
virtual void sort (int column, Qt::SortOrder order=Qt::AscendingOrder)
 Sorts the model by column in the given order. More...
 
virtual QSize span (const QModelIndex &index) const
 Returns the row and column span of the item represented by index. More...
 
Qt::DropActions supportedDragActions () const
 Returns the actions supported by the data in this model. More...
 
virtual Qt::DropActions supportedDropActions () const
 Returns the drop actions supported by this model. More...
 
virtual ~QAbstractItemModel ()
 Destroys the abstract item model. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Additional Inherited Members

- Public Slots inherited from QAbstractItemModel
virtual void revert ()
 Lets the model know that it should discard cached information. More...
 
virtual bool submit ()
 Lets the model know that it should submit cached information to permanent storage. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Slots inherited from QAbstractItemModel
void resetInternalData ()
 This slot is called just after the internal data of a model is cleared while it is being reset. More...
 
- Protected Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 Begins a column insertion operation. More...
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 Begins a row insertion operation. More...
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationColumn)
 Begins a column move operation. More...
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationRow)
 Begins a row move operation. More...
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 Begins a column removal operation. More...
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 Begins a row removal operation. More...
 
void beginResetModel ()
 Begins a model reset operation. More...
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 Changes the QPersistentModelIndex that is equal to the given from model index to the given to model index. More...
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 Changes the QPersistentModelIndexes that is equal to the indexes in the given from model index list to the given to model index list. More...
 
QModelIndex createIndex (int row, int column, void *data=0) const
 Creates a model index for the given row and column with the internal pointer ptr. More...
 
QModelIndex createIndex (int row, int column, int id) const
 Use QModelIndex QAbstractItemModel::createIndex(int row, int column, quint32 id) instead. More...
 
QModelIndex createIndex (int row, int column, quint32 id) const
 Creates a model index for the given row and column with the internal identifier, id. More...
 
bool decodeData (int row, int column, const QModelIndex &parent, QDataStream &stream)
 
void encodeData (const QModelIndexList &indexes, QDataStream &stream) const
 
void endInsertColumns ()
 Ends a column insertion operation. More...
 
void endInsertRows ()
 Ends a row insertion operation. More...
 
void endMoveColumns ()
 Ends a column move operation. More...
 
void endMoveRows ()
 Ends a row move operation. More...
 
void endRemoveColumns ()
 Ends a column removal operation. More...
 
void endRemoveRows ()
 Ends a row removal operation. More...
 
void endResetModel ()
 Completes a model reset operation. More...
 
QModelIndexList persistentIndexList () const
 Returns the list of indexes stored as persistent indexes in the model. More...
 
 QAbstractItemModel (QAbstractItemModelPrivate &dd, QObject *parent=0)
 
void reset ()
 Resets the model to its original state in any attached views. More...
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 Sets the model's role names to roleNames. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 65 of file qscriptdebuggerlocalsmodel_p.h.

Constructors and Destructors

◆ QScriptDebuggerLocalsModel()

QScriptDebuggerLocalsModel::QScriptDebuggerLocalsModel ( QScriptDebuggerJobSchedulerInterface jobScheduler,
QScriptDebuggerCommandSchedulerInterface commandScheduler,
QObject parent = 0 
)

Definition at line 444 of file qscriptdebuggerlocalsmodel.cpp.

449 {
451  d->jobScheduler = jobScheduler;
452  d->commandScheduler = commandScheduler;
453 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QAbstractItemModel(QObject *parent=0)
Constructs an abstract item model with the given parent.

◆ ~QScriptDebuggerLocalsModel()

QScriptDebuggerLocalsModel::~QScriptDebuggerLocalsModel ( )

Definition at line 455 of file qscriptdebuggerlocalsmodel.cpp.

456 {
457 }

Functions

◆ canFetchMore()

bool QScriptDebuggerLocalsModel::canFetchMore ( const QModelIndex parent) const
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 939 of file qscriptdebuggerlocalsmodel.cpp.

940 {
942  if (!parent.isValid())
943  return false;
944  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(parent);
945  return node
948 }
double d
Definition: qnumeric_p.h:62
QScriptDebuggerValueProperty property
QScriptDebuggerValue value() const
Returns the value of this QScriptDebuggerValueProperty.
#define Q_D(Class)
Definition: qglobal.h:2482
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
ValueType type() const
Returns the type of this value.

◆ columnCount()

int QScriptDebuggerLocalsModel::columnCount ( const QModelIndex parent) const
virtual

Reimplemented Function

Implements QAbstractItemModel.

Definition at line 791 of file qscriptdebuggerlocalsmodel.cpp.

792 {
793  return 2;
794 }

◆ data()

QVariant QScriptDebuggerLocalsModel::data ( const QModelIndex index,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented Function

Implements QAbstractItemModel.

Definition at line 811 of file qscriptdebuggerlocalsmodel.cpp.

812 {
814  if (!index.isValid())
815  return QVariant();
816  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(index);
817  if (role == Qt::DisplayRole) {
818  if (index.column() == 0)
819  return node->property.name();
820  else if (index.column() == 1) {
821  QString str = node->property.valueAsString();
822  if (str.indexOf(QLatin1Char('\n')) != -1) {
823  QStringList lines = str.split(QLatin1Char('\n'));
824  int lineCount = lines.size();
825  if (lineCount > 1) {
826  lines = lines.mid(0, 1);
827  lines.append(QString::fromLatin1("(... %0 more lines ...)").arg(lineCount - 1));
828  }
829  str = lines.join(QLatin1String("\n"));
830  }
831  return str;
832  }
833  } else if (role == Qt::EditRole) {
834  if ((index.column() == 1) && !d->isTopLevelNode(node)) {
835  QString str = node->property.valueAsString();
837  // escape
838  str.replace(QLatin1Char('\"'), QLatin1String("\\\""));
839  str.prepend(QLatin1Char('\"'));
840  str.append(QLatin1Char('\"'));
841  }
842  return str;
843  }
844  } else if (role == Qt::ToolTipRole) {
845  if (index.column() == 1) {
846  QString str = node->property.valueAsString();
847  if (str.indexOf(QLatin1Char('\n')) != -1)
848  return str;
849  }
850  }
851  // ### do this in the delegate
852  else if (role == Qt::BackgroundRole) {
853  if (d->isTopLevelNode(node))
854  return QBrush(Qt::darkGray);
855  } else if (role == Qt::TextColorRole) {
856  if (d->isTopLevelNode(node))
857  return QColor(Qt::white);
858  } else if (role == Qt::FontRole) {
859  if (d->isTopLevelNode(node) || node->changed) {
860  QFont fnt;
861  fnt.setBold(true);
862  return fnt;
863  }
864  }
865  return QVariant();
866 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
double d
Definition: qnumeric_p.h:62
QScriptDebuggerValueProperty property
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
QString & prepend(QChar c)
Definition: qstring.h:261
QString name() const
Returns the name of this QScriptDebuggerValueProperty.
QScriptDebuggerValue value() const
Returns the value of this QScriptDebuggerValueProperty.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
QList< T > mid(int pos, int length=-1) const
Returns a list whose elements are copied from this list, starting at position pos.
Definition: qlist.h:637
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
void setBold(bool)
If enable is true sets the font&#39;s weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
Definition: qfont.h:352
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
QString join(const QString &sep) const
Joins all the string list&#39;s strings into a single string with each element separated by the given sep...
Definition: qstringlist.h:162
ValueType type() const
Returns the type of this value.
QString & append(QChar c)
Definition: qstring.cpp:1777
The QFont class specifies a font used for drawing text.
Definition: qfont.h:64
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
int column() const
Returns the column this model index refers to.

◆ fetchMore()

void QScriptDebuggerLocalsModel::fetchMore ( const QModelIndex parent)
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 953 of file qscriptdebuggerlocalsmodel.cpp.

Referenced by rowCount().

954 {
956  d->populateIndex(parent);
957 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ flags()

Qt::ItemFlags QScriptDebuggerLocalsModel::flags ( const QModelIndex index) const
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 908 of file qscriptdebuggerlocalsmodel.cpp.

909 {
911  if (!index.isValid())
912  return 0;
913  Qt::ItemFlags ret = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
914  if ((index.column() == 1) && index.parent().isValid()) {
915  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(index);
916  if (!(node->property.flags() & QScriptValue::ReadOnly))
917  ret |= Qt::ItemIsEditable;
918  }
919  return ret;
920 }
double d
Definition: qnumeric_p.h:62
QScriptDebuggerValueProperty property
#define Q_D(Class)
Definition: qglobal.h:2482
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
QScriptValue::PropertyFlags flags() const
Returns the flags of this QScriptDebuggerValueProperty.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
int column() const
Returns the column this model index refers to.

◆ frameIndex()

int QScriptDebuggerLocalsModel::frameIndex ( ) const

Definition at line 758 of file qscriptdebuggerlocalsmodel.cpp.

Referenced by QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), init(), and sync().

759 {
761  return d->frameIndex;
762 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ hasChildren()

bool QScriptDebuggerLocalsModel::hasChildren ( const QModelIndex parent) const
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 925 of file qscriptdebuggerlocalsmodel.cpp.

926 {
928  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(parent);
929  if (!node)
930  return false;
931  return !node->children.isEmpty()
934 }
double d
Definition: qnumeric_p.h:62
QScriptDebuggerValueProperty property
QScriptDebuggerValue value() const
Returns the value of this QScriptDebuggerValueProperty.
#define Q_D(Class)
Definition: qglobal.h:2482
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QList< QScriptDebuggerLocalsModelNode * > children
ValueType type() const
Returns the type of this value.

◆ headerData()

QVariant QScriptDebuggerLocalsModel::headerData ( int  section,
Qt::Orientation  orient,
int  role = Qt::DisplayRole 
) const
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 892 of file qscriptdebuggerlocalsmodel.cpp.

893 {
894  if (orient == Qt::Horizontal) {
895  if (role == Qt::DisplayRole) {
896  if (section == 0)
897  return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Name");
898  else if (section == 1)
899  return QCoreApplication::translate("QScriptDebuggerLocalsModel", "Value");
900  }
901  }
902  return QVariant();
903 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)

◆ index()

QModelIndex QScriptDebuggerLocalsModel::index ( int  row,
int  column,
const QModelIndex parent = QModelIndex() 
) const
virtual

Reimplemented Function

Implements QAbstractItemModel.

Definition at line 767 of file qscriptdebuggerlocalsmodel.cpp.

Referenced by QScriptDebuggerLocalsModelPrivate::addTopLevelObject(), init(), sync(), and QScriptDebuggerLocalsModelPrivate::syncTopLevelNodes().

768 {
770  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(parent);
771  if ((row < 0) || (row >= node->children.count()))
772  return QModelIndex();
773  return createIndex(row, column, node->children.at(row));
774 }
double d
Definition: qnumeric_p.h:62
QModelIndex createIndex(int row, int column, void *data=0) const
Creates a model index for the given row and column with the internal pointer ptr. ...
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_D(Class)
Definition: qglobal.h:2482
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QScriptDebuggerLocalsModelNode * > children
The QModelIndex class is used to locate data in a data model.

◆ init()

void QScriptDebuggerLocalsModel::init ( int  frameIndex)

Definition at line 539 of file qscriptdebuggerlocalsmodel.cpp.

540 {
542  d->frameIndex = frameIndex;
543  QScriptDebuggerJob *job = new InitModelJob(this, frameIndex, d->commandScheduler);
544  d->jobScheduler->scheduleJob(job);
545 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ parent()

QModelIndex QScriptDebuggerLocalsModel::parent ( const QModelIndex child) const
virtual

Reimplemented Function

Implements QAbstractItemModel.

Definition at line 779 of file qscriptdebuggerlocalsmodel.cpp.

780 {
782  if (!index.isValid())
783  return QModelIndex();
784  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(index);
785  return d->indexFromNode(node->parent);
786 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
QScriptDebuggerLocalsModelNode * parent
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
The QModelIndex class is used to locate data in a data model.

◆ rowCount()

int QScriptDebuggerLocalsModel::rowCount ( const QModelIndex parent) const
virtual

Reimplemented Function

Implements QAbstractItemModel.

Definition at line 799 of file qscriptdebuggerlocalsmodel.cpp.

800 {
802  // ### need this to make it work with a sortfilterproxymodel (QSFPM is too eager)
803  const_cast<QScriptDebuggerLocalsModel*>(this)->fetchMore(parent);
804  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(parent);
805  return node ? node->children.count() : 0;
806 }
double d
Definition: qnumeric_p.h:62
void fetchMore(const QModelIndex &parent)
Reimplemented Function
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_D(Class)
Definition: qglobal.h:2482
QList< QScriptDebuggerLocalsModelNode * > children

◆ scopeObjectAvailable

void QScriptDebuggerLocalsModel::scopeObjectAvailable ( const QModelIndex index)
signal

◆ setData()

bool QScriptDebuggerLocalsModel::setData ( const QModelIndex index,
const QVariant value,
int  role = Qt::EditRole 
)
virtual

Reimplemented Function

Reimplemented from QAbstractItemModel.

Definition at line 871 of file qscriptdebuggerlocalsmodel.cpp.

872 {
874  if (!index.isValid())
875  return false;
876  if (role != Qt::EditRole)
877  return false;
878  QScriptDebuggerLocalsModelNode *node = d->nodeFromIndex(index);
879  if (!node)
880  return false;
881  QString expr = value.toString().trimmed();
882  if (expr.isEmpty())
883  return false;
884  QScriptDebuggerJob *job = new SetPropertyJob(index, expr, d->commandScheduler);
885  d->jobScheduler->scheduleJob(job);
886  return true;
887 }
double d
Definition: qnumeric_p.h:62
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
Definition: qstring.cpp:4506
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
bool isValid() const
Returns true if this model index is valid; otherwise returns false.

◆ sync()

void QScriptDebuggerLocalsModel::sync ( int  frameIndex)

Definition at line 631 of file qscriptdebuggerlocalsmodel.cpp.

632 {
634  d->frameIndex = frameIndex;
635  QScriptDebuggerJob *job = new SyncModelJob(this, frameIndex, d->commandScheduler);
636  d->jobScheduler->scheduleJob(job);
637 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

The documentation for this class was generated from the following files: