diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 3fe6698..1bcf190 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2727,6 +2727,7 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E
     p->exposed = e->isExposed && window->screen();
 
     QExposeEvent exposeEvent(e->region);
+    qDebug() << __FUNCTION__ << window;
     QCoreApplication::sendSpontaneousEvent(window, &exposeEvent);
 }
 
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 5bbe923..88b9e5b 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -649,6 +649,41 @@ static QPixmap pixmapFromShellImageList(int iImageList, const SHFILEINFO &info)
     return result;
 }
 
+static int i_Indent = 0;
+
+template <class O>
+class FunctionGuard
+{
+public:
+    explicit FunctionGuard(O o, const char *name, int *indentPtr)
+        : m_o(o), m_n(name), m_indentPtr(indentPtr)
+    {
+        indented() << '>' << m_n << m_o;
+        (*m_indentPtr)++;
+    }
+
+    ~FunctionGuard()
+    {
+        (*m_indentPtr)--;
+        indented() << '<' << m_n << m_o;
+    }
+
+    QByteArray indent() const { return QByteArray(2 * *m_indentPtr, ' '); }
+
+    QDebug indented() const {
+        QDebug d = qDebug();
+        d.noquote();
+        d << indent();
+        d.quote();
+        return d;
+    }
+
+private:
+    const O m_o;
+    const char *m_n;
+    int *m_indentPtr;
+};
+
 QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
                                       QPlatformTheme::IconOptions iconOptions) const
 {
@@ -701,6 +736,7 @@ QPixmap QWindowsTheme::fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &s
                             FILE_ATTRIBUTE_DIRECTORY,
                             &info, sizeof(SHFILEINFO), flags);
     } else {
+        FunctionGuard<QString> g(filePath, "SHGetFileInfo", &i_Indent);
         val = SHGetFileInfo(reinterpret_cast<const wchar_t *>(filePath.utf16()), 0,
                             &info, sizeof(SHFILEINFO), flags);
     }
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 2ff71d8..30151d0 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -995,6 +995,7 @@ QWindowsWindow::~QWindowsWindow()
 
 void QWindowsWindow::fireExpose(const QRegion &region, bool force)
 {
+    qDebug() << __FUNCTION__ << window() << region;
     if (region.isEmpty() && !force)
         clearFlag(Exposed);
     else
@@ -1457,6 +1458,7 @@ void QWindowsWindow::handleResized(int wParam)
 
 void QWindowsWindow::handleGeometryChange()
 {
+    qDebug() << __FUNCTION__ << window();
     //Prevent recursive resizes for Windows CE
     if (testFlag(WithinSetStyle))
         return;
@@ -1557,11 +1559,19 @@ void QWindowsWindow::releaseDC()
 bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
                                          WPARAM, LPARAM)
 {
+
+    qDebug() << __FUNCTION__ << window() << __FUNCTION__  ;
+
     // Ignore invalid update bounding rectangles
-    if (!GetUpdateRect(m_data.hwnd, 0, FALSE))
+    if (!GetUpdateRect(m_data.hwnd, 0, FALSE)) {
+         qDebug() << "!GetUpdateRect";
         return false;
-    if (message == WM_ERASEBKGND) // Backing store - ignored.
+    }
+    if (message == WM_ERASEBKGND) { // Backing store - ignored.
+        qDebug() << "WM_ERASEBKGND";
         return true;
+    }
+
     PAINTSTRUCT ps;
 
     // Observed painting problems with Aero style disabled (QTBUG-7865).
@@ -1574,8 +1584,10 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message,
     // we still need to send isExposed=true, for compatibility.
     // Our tests depend on it.
     fireExpose(QRegion(qrectFromRECT(ps.rcPaint)), true);
-    if (!QWindowsContext::instance()->asyncExpose())
+    if (!QWindowsContext::instance()->asyncExpose()) {
+        qDebug() << "flushWindowSystemEvents";
         QWindowSystemInterface::flushWindowSystemEvents();
+    }
 
     EndPaint(hwnd, &ps);
     return true;
@@ -2410,3 +2422,4 @@ void QWindowsWindow::setHasBorderInFullScreen(bool border)
 }
 
 QT_END_NAMESPACE
+;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7bd4920..0963c47 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5462,6 +5462,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
     bool onScreen = paintOnScreen();
 
     Q_Q(QWidget);
+    qDebug() << __FUNCTION__ << q;
 #ifndef QT_NO_GRAPHICSEFFECT
     if (graphicsEffect && graphicsEffect->isEnabled()) {
         QGraphicsEffectSource *source = graphicsEffect->d_func()->source;
