summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-01-04 09:44:03 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-01-04 09:50:10 (GMT)
commit81d06f72cb84485847f963ba1dfea662e51096e4 (patch)
tree991cda4786f2a50275f3780492a06f08205fe336 /src/opengl/qgl.cpp
parent5356d3717a9355830a13dfa0c8726f86a5f1c522 (diff)
downloadQt-81d06f72cb84485847f963ba1dfea662e51096e4.zip
Qt-81d06f72cb84485847f963ba1dfea662e51096e4.tar.gz
Qt-81d06f72cb84485847f963ba1dfea662e51096e4.tar.bz2
Fixed QGLFormat::operator== to handle new fields.
When I added new fields to QGLFormat in commit 592dc597, I forgot to update operator==. It has now been fixed and the auto-test updated. Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index ffce551..9d4b488 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1097,6 +1097,10 @@ int QGLFormat::stencilBufferSize() const
*/
void QGLFormat::setVersion(int major, int minor)
{
+ if (major < 1 || minor < 0) {
+ qWarning("QGLFormat::setVersion: Cannot set zero or negative version number %d.%d", major, minor);
+ return;
+ }
detach();
d->majorVersion = major;
d->minorVersion = minor;
@@ -1470,14 +1474,20 @@ void QGLFormat::setDefaultOverlayFormat(const QGLFormat &f)
bool operator==(const QGLFormat& a, const QGLFormat& b)
{
- return (int) a.d->opts == (int) b.d->opts && a.d->pln == b.d->pln && a.d->alphaSize == b.d->alphaSize
- && a.d->accumSize == b.d->accumSize && a.d->stencilSize == b.d->stencilSize
+ return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts
+ && a.d->pln == b.d->pln
+ && a.d->alphaSize == b.d->alphaSize
+ && a.d->accumSize == b.d->accumSize
+ && a.d->stencilSize == b.d->stencilSize
&& a.d->depthSize == b.d->depthSize
&& a.d->redSize == b.d->redSize
&& a.d->greenSize == b.d->greenSize
&& a.d->blueSize == b.d->blueSize
&& a.d->numSamples == b.d->numSamples
- && a.d->swapInterval == b.d->swapInterval;
+ && a.d->swapInterval == b.d->swapInterval
+ && a.d->majorVersion == b.d->majorVersion
+ && a.d->minorVersion == b.d->minorVersion
+ && a.d->profile == b.d->profile);
}