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

#include <qscriptdebuggerevent_p.h>

Public Types

enum  Attribute {
  ScriptID, FileName, BreakpointID, LineNumber,
  ColumnNumber, Value, Message, IsNestedEvaluate,
  HasExceptionHandler, UserAttribute = 1000, MaxUserAttribute = 32767
}
 
enum  Type {
  None, Interrupted, SteppingFinished, LocationReached,
  Breakpoint, Exception, Trace, InlineEvalFinished,
  DebuggerInvocationRequest, ForcedReturn, UserEvent = 1000, MaxUserEvent = 32767
}
 

Public Functions

QVariant attribute (Attribute attribute, const QVariant &defaultValue=QVariant()) const
 
QHash< Attribute, QVariantattributes () const
 
int breakpointId () const
 
int columnNumber () const
 
QString fileName () const
 
bool hasExceptionHandler () const
 
bool isNestedEvaluate () const
 
int lineNumber () const
 
QString message () const
 
bool operator!= (const QScriptDebuggerEvent &other) const
 Returns true if this QScriptDebuggerEvent is not equal to the other event, otherwise returns false. More...
 
QScriptDebuggerEventoperator= (const QScriptDebuggerEvent &other)
 
bool operator== (const QScriptDebuggerEvent &other) const
 Returns true if this QScriptDebuggerEvent is equal to the other event, otherwise returns false. More...
 
 QScriptDebuggerEvent ()
 
 QScriptDebuggerEvent (Type type)
 
 QScriptDebuggerEvent (Type type, qint64 scriptId, int lineNumber, int columnNumber)
 
 QScriptDebuggerEvent (const QScriptDebuggerEvent &other)
 
qint64 scriptId () const
 
QScriptDebuggerValue scriptValue () const
 
void setAttribute (Attribute attribute, const QVariant &value)
 
void setBreakpointId (int id)
 
void setColumnNumber (int columnNumber)
 
void setFileName (const QString &fileName)
 
void setHasExceptionHandler (bool hasHandler)
 
void setLineNumber (int lineNumber)
 
void setMessage (const QString &message)
 
void setNestedEvaluate (bool nested)
 
void setScriptId (qint64 id)
 
void setScriptValue (const QScriptDebuggerValue &value)
 
Type type () const
 
 ~QScriptDebuggerEvent ()
 

Properties

QScopedPointer< QScriptDebuggerEventPrivated_ptr
 

Friends

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

Detailed Description

Definition at line 68 of file qscriptdebuggerevent_p.h.

Enumerations

◆ Attribute

◆ Type

Constructors and Destructors

◆ QScriptDebuggerEvent() [1/4]

QScriptDebuggerEvent::QScriptDebuggerEvent ( )

Definition at line 71 of file qscriptdebuggerevent.cpp.

◆ QScriptDebuggerEvent() [2/4]

QScriptDebuggerEvent::QScriptDebuggerEvent ( Type  type)

Definition at line 77 of file qscriptdebuggerevent.cpp.

79 {
80  d_ptr->type = type;
81 }
QScopedPointer< QScriptDebuggerEventPrivate > d_ptr
QScriptDebuggerEvent::Type type

◆ QScriptDebuggerEvent() [3/4]

QScriptDebuggerEvent::QScriptDebuggerEvent ( Type  type,
qint64  scriptId,
int  lineNumber,
int  columnNumber 
)

◆ QScriptDebuggerEvent() [4/4]

QScriptDebuggerEvent::QScriptDebuggerEvent ( const QScriptDebuggerEvent other)

Definition at line 93 of file qscriptdebuggerevent.cpp.

95 {
96  *d_ptr = *other.d_ptr;
97 }
QScopedPointer< QScriptDebuggerEventPrivate > d_ptr

◆ ~QScriptDebuggerEvent()

QScriptDebuggerEvent::~QScriptDebuggerEvent ( )

Definition at line 99 of file qscriptdebuggerevent.cpp.

100 {
101 }

Functions

◆ attribute()

QVariant QScriptDebuggerEvent::attribute ( Attribute  attribute,
const QVariant defaultValue = QVariant() 
) const

Definition at line 115 of file qscriptdebuggerevent.cpp.

Referenced by setAttribute().

117 {
118  Q_D(const QScriptDebuggerEvent);
119  return d->attributes.value(attribute, defaultValue);
120 }
double d
Definition: qnumeric_p.h:62
QVariant attribute(Attribute attribute, const QVariant &defaultValue=QVariant()) const
#define Q_D(Class)
Definition: qglobal.h:2482

◆ attributes()

QHash< QScriptDebuggerEvent::Attribute, QVariant > QScriptDebuggerEvent::attributes ( ) const

Definition at line 132 of file qscriptdebuggerevent.cpp.

133 {
134  Q_D(const QScriptDebuggerEvent);
135  return d->attributes;
136 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ breakpointId()

int QScriptDebuggerEvent::breakpointId ( ) const

Definition at line 186 of file qscriptdebuggerevent.cpp.

187 {
188  Q_D(const QScriptDebuggerEvent);
189  return d->attributes.value(BreakpointID, -1).toInt();
190 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ columnNumber()

int QScriptDebuggerEvent::columnNumber ( ) const

Definition at line 174 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerEvent(), and setColumnNumber().

175 {
176  Q_D(const QScriptDebuggerEvent);
177  return d->attributes.value(ColumnNumber, -1).toInt();
178 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ fileName()

QString QScriptDebuggerEvent::fileName ( ) const

Definition at line 150 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent(), and setFileName().

151 {
152  Q_D(const QScriptDebuggerEvent);
153  return d->attributes.value(FileName).toString();
154 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ hasExceptionHandler()

bool QScriptDebuggerEvent::hasExceptionHandler ( ) const

Definition at line 240 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent().

241 {
242  Q_D(const QScriptDebuggerEvent);
243  return d->attributes.value(HasExceptionHandler).toBool();
244 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ isNestedEvaluate()

bool QScriptDebuggerEvent::isNestedEvaluate ( ) const

Definition at line 228 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent().

229 {
230  Q_D(const QScriptDebuggerEvent);
231  return d->attributes.value(IsNestedEvaluate).toBool();
232 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ lineNumber()

int QScriptDebuggerEvent::lineNumber ( ) const

Definition at line 162 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent(), QScriptDebuggerEvent(), and setLineNumber().

163 {
164  Q_D(const QScriptDebuggerEvent);
165  return d->attributes.value(LineNumber, -1).toInt();
166 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ message()

QString QScriptDebuggerEvent::message ( ) const

Definition at line 198 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent(), and setMessage().

199 {
200  Q_D(const QScriptDebuggerEvent);
201  return d->attributes.value(Message).toString();
202 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ operator!=()

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

Returns true if this QScriptDebuggerEvent is not equal to the other event, otherwise returns false.

Definition at line 266 of file qscriptdebuggerevent.cpp.

267 {
268  return !(*this == other);
269 }

◆ operator=()

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

Definition at line 103 of file qscriptdebuggerevent.cpp.

104 {
105  *d_ptr = *other.d_ptr;
106  return *this;
107 }
QScopedPointer< QScriptDebuggerEventPrivate > d_ptr

◆ operator==()

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

Returns true if this QScriptDebuggerEvent is equal to the other event, otherwise returns false.

Definition at line 250 of file qscriptdebuggerevent.cpp.

251 {
252  Q_D(const QScriptDebuggerEvent);
253  const QScriptDebuggerEventPrivate *od = other.d_func();
254  if (d == od)
255  return true;
256  if (!d || !od)
257  return false;
258  return ((d->type == od->type)
259  && (d->attributes == od->attributes));
260 }
double d
Definition: qnumeric_p.h:62
QHash< QScriptDebuggerEvent::Attribute, QVariant > attributes
QScriptDebuggerEvent::Type type
#define Q_D(Class)
Definition: qglobal.h:2482

◆ scriptId()

qint64 QScriptDebuggerEvent::scriptId ( ) const

Definition at line 138 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent(), and QScriptDebuggerEvent().

139 {
140  Q_D(const QScriptDebuggerEvent);
141  return d->attributes.value(ScriptID, -1).toLongLong();
142 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ scriptValue()

QScriptDebuggerValue QScriptDebuggerEvent::scriptValue ( ) const

Definition at line 210 of file qscriptdebuggerevent.cpp.

211 {
212  Q_D(const QScriptDebuggerEvent);
213  return qvariant_cast<QScriptDebuggerValue>(d->attributes[Value]);
214 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QScriptDebuggerValue class represents a script value.
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571

◆ setAttribute()

void QScriptDebuggerEvent::setAttribute ( Attribute  attribute,
const QVariant value 
)

Definition at line 122 of file qscriptdebuggerevent.cpp.

124 {
126  if (!value.isValid())
127  d->attributes.remove(attribute);
128  else
129  d->attributes[attribute] = value;
130 }
double d
Definition: qnumeric_p.h:62
QVariant attribute(Attribute attribute, const QVariant &defaultValue=QVariant()) const
#define Q_D(Class)
Definition: qglobal.h:2482
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485

◆ setBreakpointId()

void QScriptDebuggerEvent::setBreakpointId ( int  id)

Definition at line 192 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackendPrivate::breakpoint().

193 {
195  d->attributes[BreakpointID] = id;
196 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setColumnNumber()

void QScriptDebuggerEvent::setColumnNumber ( int  columnNumber)

Definition at line 180 of file qscriptdebuggerevent.cpp.

◆ setFileName()

void QScriptDebuggerEvent::setFileName ( const QString fileName)

◆ setHasExceptionHandler()

void QScriptDebuggerEvent::setHasExceptionHandler ( bool  hasHandler)

Definition at line 234 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackendPrivate::exception().

235 {
237  d->attributes[HasExceptionHandler] = hasHandler;
238 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setLineNumber()

void QScriptDebuggerEvent::setLineNumber ( int  lineNumber)

Definition at line 168 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackendPrivate::exception().

169 {
171  d->attributes[LineNumber] = lineNumber;
172 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setMessage()

void QScriptDebuggerEvent::setMessage ( const QString message)

◆ setNestedEvaluate()

void QScriptDebuggerEvent::setNestedEvaluate ( bool  nested)

Definition at line 222 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackend::doPendingEvaluate().

223 {
225  d->attributes[IsNestedEvaluate] = nested;
226 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setScriptId()

void QScriptDebuggerEvent::setScriptId ( qint64  id)

Definition at line 144 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackendPrivate::exception().

145 {
147  d->attributes[ScriptID] = id;
148 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

◆ setScriptValue()

void QScriptDebuggerEvent::setScriptValue ( const QScriptDebuggerValue value)

Definition at line 216 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerBackend::doPendingEvaluate(), QScriptDebuggerBackendPrivate::exception(), QScriptDebuggerBackendPrivate::forcedReturn(), and QScriptDebuggerBackendPrivate::stepped().

217 {
219  d->attributes[Value] = QVariant::fromValue(value);
220 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
Definition: qvariant.h:336

◆ type()

QScriptDebuggerEvent::Type QScriptDebuggerEvent::type ( ) const

Definition at line 109 of file qscriptdebuggerevent.cpp.

Referenced by QScriptDebuggerPrivate::debuggerEvent(), operator>>(), and QScriptDebuggerEvent().

110 {
111  Q_D(const QScriptDebuggerEvent);
112  return d->type;
113 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482

Friends and Related Functions

◆ operator<<

QDataStream & operator<< ( QDataStream out,
const QScriptDebuggerEvent event 
)
friend

Writes the given event to the specified stream.

Definition at line 280 of file qscriptdebuggerevent.cpp.

281 {
282  const QScriptDebuggerEventPrivate *d = event.d_ptr.data();
283  out << (quint32)d->type;
284  out << (qint32)d->attributes.size();
286  for (it = d->attributes.constBegin(); it != d->attributes.constEnd(); ++it) {
287  out << (quint32)it.key();
288  out << it.value();
289  }
290  return out;
291 }
double d
Definition: qnumeric_p.h:62
int qint32
Definition: qglobal.h:937
#define it(className, varName)
QHash< QScriptDebuggerEvent::Attribute, QVariant > attributes
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
QScriptDebuggerEvent::Type type
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the hash.
Definition: qhash.h:466
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:469
int size() const
Returns the number of items in the hash.
Definition: qhash.h:295
const Key key(const T &value) const
Returns the first key mapped to value.
Definition: qhash.h:674
unsigned int quint32
Definition: qglobal.h:938

◆ operator>>

QDataStream & operator>> ( QDataStream in,
QScriptDebuggerEvent event 
)
friend

Reads a QScriptDebuggerEvent from the specified stream into the given event.

Definition at line 303 of file qscriptdebuggerevent.cpp.

304 {
305  QScriptDebuggerEventPrivate *d = event.d_ptr.data();
306 
307  quint32 type;
308  in >> type;
309  d->type = QScriptDebuggerEvent::Type(type);
310 
311  qint32 attribCount;
312  in >> attribCount;
314  for (qint32 i = 0; i < attribCount; ++i) {
315  quint32 key;
316  in >> key;
317  QVariant value;
318  in >> value;
319  attribs[QScriptDebuggerEvent::Attribute(key)] = value;
320  }
321  d->attributes = attribs;
322 
323  return in;
324 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
double d
Definition: qnumeric_p.h:62
int qint32
Definition: qglobal.h:937
QHash< QScriptDebuggerEvent::Attribute, QVariant > attributes
QScriptDebuggerEvent::Type type
int key
unsigned int quint32
Definition: qglobal.h:938

Properties

◆ d_ptr

QScopedPointer<QScriptDebuggerEventPrivate> QScriptDebuggerEvent::d_ptr
private

Definition at line 141 of file qscriptdebuggerevent_p.h.

Referenced by operator=(), and QScriptDebuggerEvent().


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