45 #include "private/qabstractitemmodel_p.h" 47 #include <QtCore/qfileinfo.h> 48 #include <QtCore/qpair.h> 49 #include <QtCore/qdebug.h> 90 for (it =
nodes.constBegin(); it !=
nodes.constEnd(); ++
it) {
111 for (it =
d->nodes.begin(); it !=
d->nodes.end(); ++
it) {
124 int id =
d->nextNodeId;
165 for (it =
d->nodes.constBegin(); it !=
d->nodes.constEnd(); ++
it) {
176 for (it =
d->nodes.constBegin(); it !=
d->nodes.constEnd(); ++
it) {
198 for (it =
d->nodes.constBegin(); it !=
d->nodes.constEnd(); ++
it, ++row) {
232 int functionIndex = (
id >> 1) & ((1 << 11) - 1);
244 if ((row < 0) || (row >=
d->nodes.size()))
248 return createIndex(row, column,
d->nodes.keys().at(row) << 12);
253 return createIndex(row, column,
id | (row << 1) | 1);
288 return d->nodes.size();
328 int functionIndex = (
id >> 1) & ((1 << 11) - 1);
The QVariant class acts like a union for the most common Qt data types.
Node * findScriptNode(qint64 scriptId) const
#define QT_END_NAMESPACE
This macro expands to.
const Key key(const T &value) const
Returns the first key with value value.
int baseLineNumber() const
#define it(className, varName)
QModelIndex indexFromScriptId(qint64 id) const
QScriptDebuggerScriptsModelPrivate()
Node(qint64 sid, const QScriptScriptData &dt)
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. ...
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Reimplemented Function
~QScriptDebuggerScriptsModel()
const Key & key() const
Returns the current item's key.
QScriptScriptMap scripts() const
QPair< QString, int > scriptFunctionInfoFromIndex(const QModelIndex &index) const
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
QScriptScriptData scriptData(qint64 id) const
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
int rowCount(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
QList< QPair< QString, int > > functionsInfo
T & value() const
Returns a modifiable reference to the current item's value.
~QScriptDebuggerScriptsModelPrivate()
The QScriptScriptData class holds data associated with a script.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
qint64 internalId() const
Returns a qint64 used by the model to associate the index with the internal data structure.
void layoutAboutToBeChanged()
This signal is emitted just before the layout of a model is changed.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const T value(const Key &key) const
Returns the value associated with the key key.
const T & at(int i) const
Returns the item at index position i in the list.
void addExtraScriptInfo(qint64 id, const QMap< QString, int > &functionsInfo, const QSet< int > &executableLineNumbers)
void addScript(qint64 id, const QScriptScriptData &data)
qint64 resolveScript(const QString &fileName) const
void removeScript(qint64 id)
void layoutChanged()
This signal is emitted whenever the layout of items exposed by the model has changed; for example...
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QAbstractItemModel class provides the abstract interface for item model classes.
T & first()
Returns a reference to the first item in the list.
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
#define Q_DECLARE_PUBLIC(Class)
The QMap::iterator class provides an STL-style non-const iterator for QMap and QMultiMap.
int columnCount(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
qint64 scriptIdFromIndex(const QModelIndex &index) const
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
QObject * parent() const
Returns a pointer to the parent object.
QScriptDebuggerScriptsModel(QObject *parent=0)
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
The QModelIndex class is used to locate data in a data model.
int size() const
Returns the number of items in the list.
const T & value() const
Returns the current item's value.
QSet< int > executableLineNumbers(qint64 scriptId) const
QMap< int, Node * > nodes
The QFileInfo class provides system-independent file information.
static QString fileName(const QString &fileUrl)
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
The QMap class is a template class that provides a skip-list-based dictionary.
The QList class is a template class that provides lists.
QSet< int > executableLineNumbers