diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index 06ccfd7b01..38c5e3544d 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -1009,6 +1009,47 @@ static bool qLogEq(bool a, bool b)
     return (((!a) && (!b)) || (a && b));
 }
 
+
+QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd)
+{
+    d.nospace();
+    d << "PIXELFORMATDESCRIPTOR "
+        << "dwFlags=" << hex << showbase << pd.dwFlags << dec << noshowbase;
+    if (pd.dwFlags & PFD_DRAW_TO_WINDOW) d << " PFD_DRAW_TO_WINDOW";
+    if (pd.dwFlags & PFD_DRAW_TO_BITMAP) d << " PFD_DRAW_TO_BITMAP";
+    if (pd.dwFlags & PFD_SUPPORT_GDI) d << " PFD_SUPPORT_GDI";
+    if (pd.dwFlags & PFD_SUPPORT_OPENGL) d << " PFD_SUPPORT_OPENGL";
+    if (pd.dwFlags & PFD_GENERIC_ACCELERATED) d << " PFD_GENERIC_ACCELERATED";
+    if (pd.dwFlags & PFD_SUPPORT_DIRECTDRAW) d << " PFD_SUPPORT_DIRECTDRAW";
+    if (pd.dwFlags & PFD_DIRECT3D_ACCELERATED) d << " PFD_DIRECT3D_ACCELERATED";
+    if (pd.dwFlags & PFD_SUPPORT_COMPOSITION) d << " PFD_SUPPORT_COMPOSITION";
+    if (pd.dwFlags & PFD_GENERIC_FORMAT) d << " PFD_GENERIC_FORMAT";
+    if (pd.dwFlags & PFD_NEED_PALETTE) d << " PFD_NEED_PALETTE";
+    if (pd.dwFlags & PFD_NEED_SYSTEM_PALETTE) d << " PFD_NEED_SYSTEM_PALETTE";
+    if (pd.dwFlags & PFD_DOUBLEBUFFER) d << " PFD_DOUBLEBUFFER";
+    if (pd.dwFlags & PFD_STEREO) d << " PFD_STEREO";
+    if (pd.dwFlags & PFD_SWAP_LAYER_BUFFERS) d << " PFD_SWAP_LAYER_BUFFERS";
+    d << " iPixelType=" << pd.iPixelType << " cColorBits=" << pd.cColorBits
+        << " cRedBits=" << pd.cRedBits << " cRedShift=" << pd.cRedShift
+        << " cGreenBits=" << pd.cGreenBits << " cGreenShift=" << pd.cGreenShift
+        << " cBlueBits=" << pd.cBlueBits << " cBlueShift=" << pd.cBlueShift;
+    d  << " cDepthBits=" << pd.cDepthBits;
+    if (pd.cStencilBits)
+        d << " cStencilBits=" << pd.cStencilBits;
+    if (pd.cAuxBuffers)
+        d << " cAuxBuffers=" << pd.cAuxBuffers;
+    d << " iLayerType=" << pd.iLayerType;
+    if (pd.dwVisibleMask)
+        d << " dwVisibleMask=" << pd.dwVisibleMask;
+    if (pd.cAlphaBits)
+        d << " cAlphaBits=" << pd.cAlphaBits << " cAlphaShift=" << pd.cAlphaShift;
+    if (pd.cAccumBits)
+        d << " cAccumBits=" << pd.cAccumBits << " cAccumRedBits=" << pd.cAccumRedBits
+        << " cAccumGreenBits=" << pd.cAccumGreenBits << " cAccumBlueBits=" << pd.cAccumBlueBits
+        << " cAccumAlphaBits=" << pd.cAccumAlphaBits;
+    return d;
+}
+
 /*
   See qgl.cpp for qdoc comment.
  */
@@ -1043,6 +1084,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
         iAttributes[i++] = TRUE;
         iAttributes[i++] = WGL_COLOR_BITS_ARB;
         iAttributes[i++] = 24;
+        qDebug() << __FUNCTION__ <<  "wglChoosePixelFormatARB";
         iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
         iAttributes[i++] = d->glFormat.doubleBuffer();
         if (d->glFormat.stereo()) {
@@ -1106,10 +1148,12 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
             else
                 break;
         } while ((!valid || numFormats < 1) && iAttributes[si] > 1);
+        qDebug() << __FUNCTION__ <<  "arb: chosen=" << pixelFormat;
         chosenPfi = pixelFormat;
     }
 
     if (!chosenPfi) { // fallback if wglChoosePixelFormatARB() failed
+        qDebug() << __FUNCTION__ <<  "No ARB - fallback";
         int pmDepth = deviceIsPixmap() ? ((QPixmap*)d->paintDevice)->depth() : 0;
         PIXELFORMATDESCRIPTOR* p = (PIXELFORMATDESCRIPTOR*)dummyPfd;
         memset(p, 0, sizeof(PIXELFORMATDESCRIPTOR));
@@ -1155,6 +1199,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
         if (d->glFormat.stencil())
             p->cStencilBits = d->glFormat.stencilBufferSize() == -1 ? 8 : d->glFormat.stencilBufferSize();
         p->iLayerType = PFD_MAIN_PLANE;
+        qDebug() << __FUNCTION__ << "req=" << *p;
         chosenPfi = ChoosePixelFormat(pdc, p);
 
         if (!chosenPfi)
@@ -1189,6 +1234,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
             int bestPfi = -1;
             for (int pfi = 1; pfi <= pfiMax; pfi++) {
                 DescribePixelFormat(pdc, pfi, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
+                qDebug() << __FUNCTION__ << "pfi=" << pfi << pfd;
                 if (!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
                     continue;
                 if (deviceIsPixmap() && (!(pfd.dwFlags & PFD_DRAW_TO_BITMAP) ||
@@ -1228,6 +1274,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
                 chosenPfi = bestPfi;
         }
     }
+    qDebug() << __FUNCTION__ << "returns=" << chosenPfi;
     return chosenPfi;
 }
 
