Qt 4.8
Public Functions | Properties | Friends | List of all members
QScriptBreakpointData Class Reference

The QScriptBreakpointData class contains data associated with a breakpoint. More...

#include <qscriptbreakpointdata_p.h>

Public Functions

QString condition () const
 Returns the condition of the breakpoint. More...
 
QVariant data () const
 Returns custom data associated with the breakpoint. More...
 
QString fileName () const
 
bool hit ()
 If the ignore count is 0, this function increments the hit count and returns true. More...
 
int hitCount () const
 Returns the hit count of the breakpoint (the number of times the breakpoint has been triggered). More...
 
int ignoreCount () const
 Returns the ignore count of the breakpoint. More...
 
bool isEnabled () const
 Returns true if the breakpoint is enabled, false otherwise. More...
 
bool isSingleShot () const
 Returns true if the breakpoint is single-shot, false otherwise. More...
 
bool isValid () const
 
int lineNumber () const
 Returns the breakpoint line number. More...
 
bool operator!= (const QScriptBreakpointData &other) const
 Returns true if this QScriptBreakpointData is not equal to the other data, otherwise returns false. More...
 
QScriptBreakpointDataoperator= (const QScriptBreakpointData &other)
 Assigns other to this QScriptBreakpointData. More...
 
bool operator== (const QScriptBreakpointData &other) const
 Returns true if this QScriptBreakpointData is equal to the other data, otherwise returns false. More...
 
 QScriptBreakpointData ()
 Constructs an empty QScriptBreakpointData. More...
 
 QScriptBreakpointData (qint64 scriptId, int lineNumber)
 Constructs a QScriptBreakpointData with the given lineNumber. More...
 
 QScriptBreakpointData (const QString &fileName, int lineNumber)
 Constructs a QScriptBreakpointData with the given lineNumber. More...
 
 QScriptBreakpointData (const QScriptBreakpointData &other)
 Constructs a QScriptBreakpointData that is a copy of other. More...
 
qint64 scriptId () const
 
void setCondition (const QString &condition)
 Sets the condition of the breakpoint. More...
 
void setData (const QVariant &data)
 Sets custom data associated with the breakpoint. More...
 
void setEnabled (bool enabled)
 Sets the enabled state of the breakpoint. More...
 
void setFileName (const QString &fileName)
 
void setIgnoreCount (int count)
 Sets the ignore count of the breakpoint. More...
 
void setLineNumber (int lineNumber)
 Sets the breakpoint line number to lineNumber. More...
 
void setScriptId (qint64 id)
 
void setSingleShot (bool singleShot)
 Sets the singleShot state of the breakpoint. More...
 
 ~QScriptBreakpointData ()
 Destroys this QScriptBreakpointData. More...
 

Properties

QScopedPointer< QScriptBreakpointDataPrivated_ptr
 

Friends

Q_AUTOTEST_EXPORT QDataStreamoperator<< (QDataStream &, const QScriptBreakpointData &)
 Writes the given data to the specified stream. More...
 
Q_AUTOTEST_EXPORT QDataStreamoperator>> (QDataStream &, QScriptBreakpointData &)
 Reads a QScriptBreakpointData from the specified stream into the given data. More...
 

Detailed Description

The QScriptBreakpointData class contains data associated with a breakpoint.

Since
4.5
Warning
This function is not part of the public interface.

Definition at line 66 of file qscriptbreakpointdata_p.h.

Constructors and Destructors

◆ QScriptBreakpointData() [1/4]

QScriptBreakpointData::QScriptBreakpointData ( )

Constructs an empty QScriptBreakpointData.

Definition at line 101 of file qscriptbreakpointdata.cpp.

103 {
104  d_ptr->init(/*lineNumber=*/-1);
105 }
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr

◆ QScriptBreakpointData() [2/4]

QScriptBreakpointData::QScriptBreakpointData ( qint64  scriptId,
int  lineNumber 
)

Constructs a QScriptBreakpointData with the given lineNumber.

Definition at line 110 of file qscriptbreakpointdata.cpp.

112 {
115 }
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr
int lineNumber() const
Returns the breakpoint line number.

◆ QScriptBreakpointData() [3/4]

QScriptBreakpointData::QScriptBreakpointData ( const QString fileName,
int  lineNumber 
)

Constructs a QScriptBreakpointData with the given lineNumber.

Definition at line 120 of file qscriptbreakpointdata.cpp.

122 {
125 }
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr
int lineNumber() const
Returns the breakpoint line number.

◆ QScriptBreakpointData() [4/4]

QScriptBreakpointData::QScriptBreakpointData ( const QScriptBreakpointData other)

Constructs a QScriptBreakpointData that is a copy of other.

Definition at line 130 of file qscriptbreakpointdata.cpp.

132 {
133  Q_ASSERT(other.d_ptr != 0);
134  *d_ptr = *other.d_ptr;
135 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr

◆ ~QScriptBreakpointData()

QScriptBreakpointData::~QScriptBreakpointData ( )

Destroys this QScriptBreakpointData.

Definition at line 140 of file qscriptbreakpointdata.cpp.

141 {
142 }

Functions

◆ condition()

QString QScriptBreakpointData::condition ( ) const

Returns the condition of the breakpoint.

Definition at line 280 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataToScriptValue(), QScriptBreakpointsModel::data(), QScriptDebuggerAgent::positionChange(), and setCondition().

281 {
282  Q_D(const QScriptBreakpointData);
283  return d->condition;
284 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ data()

QVariant QScriptBreakpointData::data ( ) const

Returns custom data associated with the breakpoint.

Definition at line 298 of file qscriptbreakpointdata.cpp.

Referenced by setData().

299 {
300  Q_D(const QScriptBreakpointData);
301  return d->data;
302 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ fileName()

QString QScriptBreakpointData::fileName ( ) const

◆ hit()

bool QScriptBreakpointData::hit ( )

If the ignore count is 0, this function increments the hit count and returns true.

Otherwise, it decrements the ignore count and returns false.

Definition at line 256 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerAgent::positionChange().

257 {
259  if (d->ignoreCount == 0) {
260  ++d->hitCount;
261  return true;
262  }
263  --d->ignoreCount;
264  return false;
265 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ hitCount()

int QScriptBreakpointData::hitCount ( ) const

Returns the hit count of the breakpoint (the number of times the breakpoint has been triggered).

Definition at line 271 of file qscriptbreakpointdata.cpp.

Referenced by QScriptBreakpointsModel::data().

272 {
273  Q_D(const QScriptBreakpointData);
274  return d->hitCount;
275 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ ignoreCount()

int QScriptBreakpointData::ignoreCount ( ) const

Returns the ignore count of the breakpoint.

Definition at line 236 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataToScriptValue(), and QScriptBreakpointsModel::data().

237 {
238  Q_D(const QScriptBreakpointData);
239  return d->ignoreCount;
240 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ isEnabled()

bool QScriptBreakpointData::isEnabled ( ) const

Returns true if the breakpoint is enabled, false otherwise.

Definition at line 200 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsDataChanged(), breakpointDataToScriptValue(), QScriptBreakpointsModel::data(), and QScriptDebuggerAgent::positionChange().

201 {
202  Q_D(const QScriptBreakpointData);
203  return d->enabled;
204 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ isSingleShot()

bool QScriptBreakpointData::isSingleShot ( ) const

Returns true if the breakpoint is single-shot, false otherwise.

Definition at line 218 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataToScriptValue(), QScriptBreakpointsModel::data(), and QScriptDebuggerPrivate::debuggerEvent().

219 {
220  Q_D(const QScriptBreakpointData);
221  return d->singleShot;
222 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ isValid()

bool QScriptBreakpointData::isValid ( ) const

Definition at line 313 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerCommandExecutor::execute(), QScriptDebuggerBackend::setBreakpoint(), and QScriptBreakpointsModel::setData().

314 {
315  Q_D(const QScriptBreakpointData);
316  return (((d->scriptId != -1) || !d->fileName.isEmpty())
317  && (d->lineNumber != -1));
318 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ lineNumber()

int QScriptBreakpointData::lineNumber ( ) const

Returns the breakpoint line number.

Definition at line 182 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsAboutToBeRemoved(), QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsDataChanged(), QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointsInserted(), breakpointDataToScriptValue(), QScriptBreakpointsModel::data(), QScriptDebuggerAgent::positionChange(), and setLineNumber().

183 {
184  Q_D(const QScriptBreakpointData);
185  return d->lineNumber;
186 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ operator!=()

bool QScriptBreakpointData::operator!= ( const QScriptBreakpointData other) const

Returns true if this QScriptBreakpointData is not equal to the other data, otherwise returns false.

Definition at line 347 of file qscriptbreakpointdata.cpp.

348 {
349  return !(*this == other);
350 }

◆ operator=()

QScriptBreakpointData & QScriptBreakpointData::operator= ( const QScriptBreakpointData other)

Assigns other to this QScriptBreakpointData.

Definition at line 147 of file qscriptbreakpointdata.cpp.

148 {
149  Q_ASSERT(d_ptr != 0);
150  Q_ASSERT(other.d_ptr != 0);
151  *d_ptr = *other.d_ptr;
152  return *this;
153 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr

◆ operator==()

bool QScriptBreakpointData::operator== ( const QScriptBreakpointData other) const

Returns true if this QScriptBreakpointData is equal to the other data, otherwise returns false.

Definition at line 324 of file qscriptbreakpointdata.cpp.

325 {
326  Q_D(const QScriptBreakpointData);
327  const QScriptBreakpointDataPrivate *od = other.d_func();
328  if (d == od)
329  return true;
330  if (!d || !od)
331  return false;
332  return ((d->scriptId == od->scriptId)
333  && (d->fileName == od->fileName)
334  && (d->lineNumber == od->lineNumber)
335  && (d->enabled == od->enabled)
336  && (d->singleShot == od->singleShot)
337  && (d->condition == od->condition)
338  && (d->ignoreCount == od->ignoreCount)
339  && (d->data == od->data)
340  && (d->hitCount == od->hitCount));
341 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ scriptId()

qint64 QScriptBreakpointData::scriptId ( ) const

◆ setCondition()

void QScriptBreakpointData::setCondition ( const QString condition)

Sets the condition of the breakpoint.

Definition at line 289 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataFromScriptValue(), and QScriptBreakpointsModel::setData().

290 {
292  d->condition = condition;
293 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.
QString condition() const
Returns the condition of the breakpoint.

◆ setData()

void QScriptBreakpointData::setData ( const QVariant data)

Sets custom data associated with the breakpoint.

Definition at line 307 of file qscriptbreakpointdata.cpp.

308 {
310  d->data = data;
311 }
double d
Definition: qnumeric_p.h:62
QVariant data() const
Returns custom data associated with the breakpoint.
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ setEnabled()

void QScriptBreakpointData::setEnabled ( bool  enabled)

Sets the enabled state of the breakpoint.

Definition at line 209 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointEnableRequest(), breakpointDataFromScriptValue(), and QScriptBreakpointsModel::setData().

210 {
212  d->enabled = enabled;
213 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.
#define enabled

◆ setFileName()

void QScriptBreakpointData::setFileName ( const QString fileName)

Definition at line 173 of file qscriptbreakpointdata.cpp.

Referenced by QScriptDebuggerCodeWidgetPrivate::_q_onBreakpointToggleRequest(), QScriptDebuggerPrivate::_q_toggleBreakpoint(), and breakpointDataFromScriptValue().

174 {
176  d->fileName = fileName;
177 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ setIgnoreCount()

void QScriptBreakpointData::setIgnoreCount ( int  count)

Sets the ignore count of the breakpoint.

Definition at line 245 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataFromScriptValue(), and QScriptBreakpointsModel::setData().

246 {
248  d->ignoreCount = count;
249 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ setLineNumber()

void QScriptBreakpointData::setLineNumber ( int  lineNumber)

Sets the breakpoint line number to lineNumber.

Definition at line 191 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataFromScriptValue().

192 {
194  d->lineNumber = lineNumber;
195 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.
int lineNumber() const
Returns the breakpoint line number.

◆ setScriptId()

void QScriptBreakpointData::setScriptId ( qint64  id)

Definition at line 161 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataFromScriptValue().

162 {
164  d->scriptId = id;
165 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

◆ setSingleShot()

void QScriptBreakpointData::setSingleShot ( bool  singleShot)

Sets the singleShot state of the breakpoint.

Definition at line 227 of file qscriptbreakpointdata.cpp.

Referenced by breakpointDataFromScriptValue(), and QScriptBreakpointsModel::setData().

228 {
230  d->singleShot = singleShot;
231 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptBreakpointData class contains data associated with a breakpoint.

Friends and Related Functions

◆ operator<<

QDataStream & operator<< ( QDataStream out,
const QScriptBreakpointData data 
)
friend

Writes the given data to the specified stream.

Definition at line 361 of file qscriptbreakpointdata.cpp.

362 {
363  const QScriptBreakpointDataPrivate *d = data.d_ptr.data();
364  out << d->scriptId;
365  out << d->fileName;
366  out << d->lineNumber;
367  out << d->enabled;
368  out << d->singleShot;
369  out << d->ignoreCount;
370  out << d->condition;
371  out << d->data;
372  out << d->hitCount;
373  return out;
374 }
double d
Definition: qnumeric_p.h:62
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr

◆ operator>>

QDataStream & operator>> ( QDataStream in,
QScriptBreakpointData data 
)
friend

Reads a QScriptBreakpointData from the specified stream into the given data.

Definition at line 386 of file qscriptbreakpointdata.cpp.

387 {
389  in >> d->scriptId;
390  in >> d->fileName;
391  in >> d->lineNumber;
392  in >> d->enabled;
393  in >> d->singleShot;
394  in >> d->ignoreCount;
395  in >> d->condition;
396  in >> d->data;
397  in >> d->hitCount;
398  return in;
399 }
double d
Definition: qnumeric_p.h:62
T * data() const
Returns the value of the pointer referenced by this object.
QScopedPointer< QScriptBreakpointDataPrivate > d_ptr

Properties

◆ d_ptr

QScopedPointer<QScriptBreakpointDataPrivate> QScriptBreakpointData::d_ptr
private

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