47 #include "private/qabstractitemmodel_p.h" 49 #include <QtCore/qpair.h> 50 #include <QtCore/qcoreapplication.h> 51 #include <QtGui/qicon.h> 52 #include <QtCore/qdebug.h> 90 d->jobScheduler = jobScheduler;
91 d->commandScheduler = commandScheduler;
136 d->jobScheduler->scheduleJob(job);
148 m_id(
id), m_data(data)
178 d->jobScheduler->scheduleJob(job);
218 d->jobScheduler->scheduleJob(job);
228 int rowIndex =
d->breakpoints.size();
240 for (
int i = 0; i <
d->breakpoints.size(); ++i) {
241 if (
d->breakpoints.at(i).first == id) {
257 for (
int i = 0; i <
d->breakpoints.size(); ++i) {
258 if (
d->breakpoints.at(i).first == id) {
260 d->breakpoints.removeAt(i);
273 return d->breakpoints.at(row).first;
282 return d->breakpoints.at(row).second;
288 for (
int i = 0; i <
d->breakpoints.size(); ++i) {
289 if (
d->breakpoints.at(i).first == id)
290 return d->breakpoints.at(i).second;
303 for (
int i = 0; i <
d->breakpoints.size(); ++i) {
304 if ((
d->breakpoints.at(i).second.scriptId() == scriptId)
305 && (
d->breakpoints.at(i).second.lineNumber() == lineNumber)) {
306 return d->breakpoints.at(i).first;
315 for (
int i = 0; i <
d->breakpoints.size(); ++i) {
316 if ((
d->breakpoints.at(i).second.fileName() ==
fileName)
317 && (
d->breakpoints.at(i).second.lineNumber() == lineNumber)) {
318 return d->breakpoints.at(i).first;
332 if ((row < 0) || (row >=
d->breakpoints.size()))
364 return d->breakpoints.size();
374 if (!index.
isValid() || (index.
row() >=
d->breakpoints.size()))
386 }
else if (index.
column() == 2) {
389 }
else if (index.
column() == 3) {
392 }
else if (index.
column() == 5) {
396 if (index.
column() == 0) {
398 }
else if (index.
column() == 4) {
404 else if (index.
column() == 3)
416 if (!index.
isValid() || (index.
row() >=
d->breakpoints.size()))
421 if ((col == 0) || (col == 4)) {
423 modifiedData = item.
second;
429 }
else if (col == 2) {
431 modifiedData = item.
second;
434 }
else if (col == 3) {
436 modifiedData = item.
second;
443 d->jobScheduler->scheduleJob(job);
456 else if (section == 1)
458 else if (section == 2)
460 else if (section == 3)
462 else if (section == 4)
464 else if (section == 5)
The QVariant class acts like a union for the most common Qt data types.
int rowCount(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
bool isSingleShot() const
Returns true if the breakpoint is single-shot, false otherwise.
~QScriptBreakpointsModelPrivate()
#define QT_END_NAMESPACE
This macro expands to.
int breakpointIdAt(int row) const
Returns the id of the breakpoint at the given row.
QScriptBreakpointData breakpointDataAt(int row) const
Returns the data for the breakpoint at the given row.
void deleteBreakpoint(int id)
Deletes the breakpoint with the given id.
QScriptDebuggerCommandSchedulerInterface * commandScheduler
The QScriptDebuggerResponse class represents a front-end's response to a QScriptDebuggerCommand.
int scheduleSetBreakpoint(const QString &fileName, int lineNumber)
QScriptBreakpointsModel(QScriptDebuggerJobSchedulerInterface *jobScheduler, QScriptDebuggerCommandSchedulerInterface *commandScheduler, QObject *parent=0)
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
int ignoreCount() const
Returns the ignore count of the breakpoint.
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. ...
void endInsertRows()
Ends a row insertion operation.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
static QString translate(const char *context, const char *key, const char *disambiguation=0, Encoding encoding=CodecForTr)
~QScriptBreakpointsModel()
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
void setSingleShot(bool singleShot)
Sets the singleShot state of the breakpoint.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int row() const
Returns the row this model index refers to.
void setIgnoreCount(int count)
Sets the ignore count of the breakpoint.
void modifyBreakpoint(int id, const QScriptBreakpointData &data)
Modify the data of breakpoint id.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Reimplemented Function
void setEnabled(bool enabled)
Sets the enabled state of the breakpoint.
int columnCount(const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
void endRemoveRows()
Ends a row removal operation.
void setCondition(const QString &condition)
Sets the condition of the breakpoint.
The QScriptBreakpointData class contains data associated with a breakpoint.
QScriptBreakpointData breakpointData(int id) const
void setBreakpointData(int id, const QScriptBreakpointData &data)
Sets the data associated with the breakpoint identified by id.
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.
QList< QPair< int, QScriptBreakpointData > > breakpoints
QScriptDebuggerJobSchedulerInterface * jobScheduler
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
void setBreakpoint(const QScriptBreakpointData &data)
Sets a breakpoint defined by the given data.
QScriptBreakpointsModelPrivate()
#define Q_DECLARE_PUBLIC(Class)
void addBreakpoint(int id, const QScriptBreakpointData &data)
Adds a breakpoint to the model.
QString & append(QChar c)
bool isEnabled() const
Returns true if the breakpoint is enabled, false otherwise.
int scheduleDeleteBreakpoint(int id)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QObject * parent() const
Returns a pointer to the parent object.
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
Begins a row removal operation.
The QModelIndex class is used to locate data in a data model.
void removeBreakpoint(int id)
Remove the breakpoint identified by id from the model.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This signal is emitted whenever the data in an existing item changes.
if(void) toggleToolbarShown
QVariant headerData(int section, Qt::Orientation, int role=Qt::DisplayRole) const
Reimplemented Function
QString condition() const
Returns the condition of the breakpoint.
int hitCount() const
Returns the hit count of the breakpoint (the number of times the breakpoint has been triggered)...
int scheduleSetBreakpointData(int id, const QScriptBreakpointData &data)
int resolveBreakpoint(qint64 scriptId, int lineNumber) const
Tries to find a breakpoint with the given scriptId and lineNumber.
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Reimplemented Function
int lineNumber() const
Returns the breakpoint line number.
static QString fileName(const QString &fileUrl)
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Reimplemented Function
void beginInsertRows(const QModelIndex &parent, int first, int last)
Begins a row insertion operation.
int column() const
Returns the column this model index refers to.
Qt::ItemFlags flags(const QModelIndex &index) const
Reimplemented Function
The QList class is a template class that provides lists.