diff options
author | axis <qt-info@nokia.com> | 2010-09-02 14:11:46 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-09-02 14:14:39 (GMT) |
commit | 3ea9920383d6841afdbfc2819358ee5debd9ac36 (patch) | |
tree | df7ed1ab5c927b16e49c29e2929bd31296e29146 /src/gui/symbian | |
parent | f1440333a685a80c52df79d457022e1e43b011a3 (diff) | |
download | Qt-3ea9920383d6841afdbfc2819358ee5debd9ac36.zip Qt-3ea9920383d6841afdbfc2819358ee5debd9ac36.tar.gz Qt-3ea9920383d6841afdbfc2819358ee5debd9ac36.tar.bz2 |
Added a QDebug operator for QSymbianEvent.
Diffstat (limited to 'src/gui/symbian')
-rw-r--r-- | src/gui/symbian/qsymbianevent.cpp | 33 | ||||
-rw-r--r-- | src/gui/symbian/qsymbianevent.h | 4 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/gui/symbian/qsymbianevent.cpp b/src/gui/symbian/qsymbianevent.cpp index c341413..a7cfeef 100644 --- a/src/gui/symbian/qsymbianevent.cpp +++ b/src/gui/symbian/qsymbianevent.cpp @@ -40,6 +40,9 @@ ****************************************************************************/ #include "qsymbianevent.h" +#include <qdebug.h> + +#include <w32std.h> QT_BEGIN_NAMESPACE @@ -140,4 +143,34 @@ int QSymbianEvent::resourceChangeType() const return (m_type == ResourceChangeEvent) ? m_eventValue : 0; } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QSymbianEvent *o) +{ + if (!o) { + dbg << "QSymbianEvent(0x0)"; + return dbg; + } + dbg.nospace() << "QSymbianEvent("; + switch (o->type()) { + case QSymbianEvent::InvalidEvent: + dbg << "InvalidEvent"; + break; + case QSymbianEvent::WindowServerEvent: + dbg << "WindowServerEvent, Type = " << o->windowServerEvent()->Type(); + break; + case QSymbianEvent::CommandEvent: + dbg << "CommandEvent, command = " << o->command(); + break; + case QSymbianEvent::ResourceChangeEvent: + dbg << "ResourceChangeEvent, resourceChangeType = " << o->resourceChangeType(); + break; + default: + dbg << "Unknown event type"; + break; + } + dbg << ")"; + return dbg.space(); +} +#endif + QT_END_NAMESPACE diff --git a/src/gui/symbian/qsymbianevent.h b/src/gui/symbian/qsymbianevent.h index 5cad654..4c9ae65 100644 --- a/src/gui/symbian/qsymbianevent.h +++ b/src/gui/symbian/qsymbianevent.h @@ -95,6 +95,10 @@ inline bool QSymbianEvent::isValid() const return m_type != InvalidEvent; } +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QSymbianEvent *o); +#endif + QT_END_NAMESPACE QT_END_HEADER |