diff options
-rw-r--r-- | src/opengl/qgl.cpp | 26 | ||||
-rw-r--r-- | src/opengl/qgl.h | 7 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index b4c85ac..9effb34 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1521,6 +1521,32 @@ bool operator==(const QGLFormat& a, const QGLFormat& b) && a.d->profile == b.d->profile); } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug dbg, const QGLFormat &f) +{ + const QGLFormatPrivate * const d = f.d; + + dbg.nospace() << "QGLFormat(" + << "options " << d->opts + << ", plane " << d->pln + << ", depthBufferSize " << d->depthSize + << ", accumBufferSize " << d->accumSize + << ", stencilBufferSize " << d->stencilSize + << ", redBufferSize " << d->redSize + << ", greenBufferSize " << d->greenSize + << ", blueBufferSize " << d->blueSize + << ", alphaBufferSize " << d->alphaSize + << ", samples " << d->numSamples + << ", swapInterval " << d->swapInterval + << ", majorVersion " << d->majorVersion + << ", minorVersion " << d->minorVersion + << ", profile " << d->profile + << ')'; + + return dbg.space(); +} +#endif + /*! Returns false if all the options of the two QGLFormat objects diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index f0b36f7..f85cad5 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -281,6 +281,9 @@ private: friend Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&); friend Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&); +#ifndef QT_NO_DEBUG_STREAM + friend Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &); +#endif }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags) @@ -288,6 +291,10 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFormat::OpenGLVersionFlags) Q_OPENGL_EXPORT bool operator==(const QGLFormat&, const QGLFormat&); Q_OPENGL_EXPORT bool operator!=(const QGLFormat&, const QGLFormat&); +#ifndef QT_NO_DEBUG_STREAM +Q_OPENGL_EXPORT QDebug operator<<(QDebug, const QGLFormat &); +#endif + class Q_OPENGL_EXPORT QGLContext { Q_DECLARE_PRIVATE(QGLContext) |