Qt 4.8
Classes | Functions
qscriptdebuggerevent_p.h File Reference
#include <QtCore/qobjectdefs.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qhash.h>
#include <QtCore/qvariant.h>
#include <QtCore/qscopedpointer.h>

Go to the source code of this file.

Classes

class  QScriptDebuggerEvent
 
class  QScriptDebuggerEventEvent
 

Functions

Q_AUTOTEST_EXPORT QDataStreamoperator<< (QDataStream &, const QScriptDebuggerEvent &)
 
Q_AUTOTEST_EXPORT QDataStreamoperator>> (QDataStream &, QScriptDebuggerEvent &)
 

Function Documentation

◆ operator<<()

Q_AUTOTEST_EXPORT QDataStream& operator<< ( QDataStream ,
const QScriptDebuggerEvent  
)

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>>()

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 type
Definition: qmetatype.cpp:239
int qint32
Definition: qglobal.h:937
QHash< QScriptDebuggerEvent::Attribute, QVariant > attributes
QScriptDebuggerEvent::Type type
int key
unsigned int quint32
Definition: qglobal.h:938