44 #include <QtCore/qdatastream.h> 45 #include <QtCore/qurl.h> 46 #include <QtCore/qtimer.h> 49 #ifdef CUSTOM_DECLARATIVE_DEBUG_TRACE_INSTANCE 53 class GlobalInstanceDeleter
61 ~GlobalInstanceDeleter()
74 return QDeclarativeDebugTrace::globalInstance();
79 if (!s_globalInstance) {
83 if (!s_globalInstance.testAndSetOrdered(0, x))
86 static GlobalInstanceDeleter
cleanup(s_globalInstance);
88 return s_globalInstance;
98 if (!s_globalInstance.testAndSetOrdered(0, custom_instance)) {
99 qWarning() <<
"QDeclarativeDebugTrace::setGlobalInstance() - instance already set.";
100 delete custom_instance;
102 static GlobalInstanceDeleter
cleanup(s_globalInstance);
106 #else // CUSTOM_DECLARATIVE_DEBUG_TRACE_INSTANCE 118 ds << time << messageType << detailType;
122 ds << detailData << line;
128 m_enabled(false), m_deferredSend(true), m_messageReceived(false)
141 traceInstance()->addEventImpl(t);
147 traceInstance()->startRangeImpl(t);
153 traceInstance()->rangeDataImpl(t, data);
159 traceInstance()->rangeDataImpl(t, data);
165 traceInstance()->rangeLocationImpl(t, fileName, line);
171 traceInstance()->rangeLocationImpl(t, fileName, line);
177 traceInstance()->endRangeImpl(t);
void addEventImpl(EventType)
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
static void addEvent(EventType)
static void rangeLocation(RangeType, const QString &, int)
void endRangeImpl(RangeType)
The QByteArray class provides an array of bytes.
void processMessage(const QDeclarativeDebugData &)
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
#define Q_BASIC_ATOMIC_INITIALIZER(a)
void rangeDataImpl(RangeType, const QString &)
virtual void messageReceived(const QByteArray &)
void rangeLocationImpl(RangeType, const QString &, int)
void append(const T &t)
Inserts value at the end of the list.
const T & at(int i) const
Returns the item at index position i in the list.
Q_CORE_EXPORT void qWarning(const char *,...)
qint64 nsecsElapsed() const
Returns the number of nanoseconds since this QElapsedTimer was last started.
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
void clear()
Removes all items from the list.
static bool isDebuggingEnabled()
FormattingOption
The formatting options define how the URL is formatted when written out as text.
static void endRange(RangeType)
static void startRange(RangeType)
void startRangeImpl(RangeType)
Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance)
QList< QDeclarativeDebugData > m_data
static void rangeData(RangeType, const QString &)
The QDataStream class provides serialization of binary data to a QIODevice.
QByteArray toByteArray() const
static QString fileName(const QString &fileUrl)
void start()
Starts this timer.
void sendMessage(const QByteArray &)