diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.cpp b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
index 8f63583..a0e7c7b 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.cpp
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.cpp
@@ -61,8 +61,13 @@ LicenseWizard::LicenseWizard(QWidget *parent)
 
 //! [3]
 #ifndef Q_OS_MAC
-//! [3] //! [4]
+// [3] //! [4]
+    qDebug() << QT_VERSION_STR << QGuiApplication::platformName();
+
+    qDebug() << __FUNCTION__ << '>';
     setWizardStyle(ModernStyle);
+    qDebug() << __FUNCTION__<< '<';
+
 #endif
 //! [4] //! [5]
     setOption(HaveHelpButton, true);
@@ -78,6 +83,19 @@ LicenseWizard::LicenseWizard(QWidget *parent)
 }
 //! [6] //! [8]
 
+void LicenseWizard::resizeEvent(QResizeEvent *e)
+{
+    qDebug() <<__FUNCTION__ << e->oldSize() << e->size() << "spont" <<e->spontaneous();
+    QWizard::resizeEvent(e);
+}
+
+void LicenseWizard::moveEvent(QMoveEvent *e)
+{
+    qDebug() <<__FUNCTION__ << e->oldPos() << e->pos() <<   "spont" <<e->spontaneous();
+    QWizard::moveEvent(e);
+
+}
+
 //! [9] //! [10]
 void LicenseWizard::showHelp()
 //! [9] //! [11]
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.h b/examples/widgets/dialogs/licensewizard/licensewizard.h
index a6dc0ae..62ac079 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.h
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.h
@@ -64,6 +64,9 @@ public:
 
     LicenseWizard(QWidget *parent = 0);
 
+    void resizeEvent(QResizeEvent *e);
+    void moveEvent(QMoveEvent *);
+
 private slots:
     void showHelp();
 //! [3]
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.pro b/examples/widgets/dialogs/licensewizard/licensewizard.pro
index fc03796..35cab44 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.pro
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.pro
@@ -4,7 +4,7 @@ HEADERS       = licensewizard.h
 SOURCES       = licensewizard.cpp \
                 main.cpp
 RESOURCES     = licensewizard.qrc
-
+CONFIG+=console
 # install
 target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/licensewizard
 INSTALLS += target
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 8ccff43..0ceeaca 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1965,6 +1965,10 @@ void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePr
     bool isResize = oldRect.size() != newRect.size();
     bool isMove = oldRect.topLeft() != newRect.topLeft();
 
+    qDebug() << __FUNCTION__ << "e->oldGeometry.isNull()" << e->oldGeometry.isNull()
+             << oldRect << "-->" << newRect << "isResize" << isResize
+             <<"isMove"  << isMove << "resizeEventPending" << window->d_func()->resizeEventPending;
+
     window->d_func()->geometry = newRect;
 
     if (isResize || window->d_func()->resizeEventPending) {
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 40e9b97..c5bd034 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -491,6 +491,7 @@ void QWindow::create()
 {
     Q_D(QWindow);
     if (!d->platformWindow) {
+        qDebug() << __FUNCTION__<< this << geometry();
         d->platformWindow = QGuiApplicationPrivate::platformIntegration()->createPlatformWindow(this);
         QObjectList childObjects = children();
         for (int i = 0; i < childObjects.size(); i ++) {
@@ -1348,6 +1349,7 @@ void QWindow::setGeometry(int posx, int posy, int w, int h)
 */
 void QWindow::setGeometry(const QRect &rect)
 {
+    qDebug() << __FUNCTION__<< this << rect;
     Q_D(QWindow);
     d->positionAutomatic = false;
     if (rect == geometry())
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 49ff8bc..b854f42 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -146,6 +146,7 @@ void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState
  */
 void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &newRect, const QRect &oldRect)
 {
+    qDebug() << __FUNCTION__ << tlw << newRect << "from" << oldRect;
     QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect, oldRect);
     QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
 }
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index c8eaded..f1478cd 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -567,6 +567,8 @@ QWindowsWindowData
     const QString windowClassName = QWindowsContext::instance()->registerWindowClass(w, isGL);
 
     QRect rect = QPlatformWindow::initialGeometry(w, data.geometry, defaultWindowWidth, defaultWindowHeight);
+    if (rect != data.geometry)
+        qDebug() << __FUNCTION__ << "Geom after QPlatformWindow::initialGeometry" << data.geometry<< "-->" << rect;
 
     if (title.isEmpty() && (result.flags & Qt::WindowTitleHint))
         title = topLevel ? qAppName() : w->objectName();
@@ -1340,6 +1342,7 @@ void QWindowsWindow::setGeometry(const QRect &rectIn)
 
 void QWindowsWindow::handleMoved()
 {
+    qDebug() << __FUNCTION__ ;
     // Minimize/Set parent can send nonsensical move events.
     if (!IsIconic(m_data.hwnd) && !testFlag(WithinSetParent))
         handleGeometryChange();
@@ -1363,6 +1366,7 @@ void QWindowsWindow::handleResized(int wParam)
             handleWindowStateChange(Qt::WindowFullScreen);
         else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen))
             handleWindowStateChange(Qt::WindowNoState);
+        qDebug() << __FUNCTION__ << wParam;
         handleGeometryChange();
         break;
     }
@@ -1376,6 +1380,7 @@ void QWindowsWindow::handleGeometryChange()
     const QRect previousGeometry = m_data.geometry;
     m_data.geometry = geometry_sys();
     QPlatformWindow::setGeometry(m_data.geometry);
+    qDebug() << __FUNCTION__ << window() << m_data.geometry << previousGeometry;
     QWindowSystemInterface::handleGeometryChange(window(), m_data.geometry);
     // QTBUG-32121: OpenGL/normal windows (with exception of ANGLE) do not receive
     // expose events when shrinking, synthesize.
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index b294e98..779b4d8 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1337,6 +1337,7 @@ void QWizardPrivate::updateLayout()
 
 void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info)
 {
+    qDebug() << __FUNCTION__ << '>';
     Q_Q(QWizard);
 
     int extraHeight = 0;
@@ -1370,6 +1371,7 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info)
         maximumHeight = maximumSize.height();
         q->setMaximumHeight(maximumHeight);
     }
+    qDebug() << __FUNCTION__ << '<';
 }
 
 void QWizardPrivate::updateCurrentPage()
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7396808..01c6ede 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -3713,6 +3713,8 @@ bool QWidgetPrivate::setMaximumSize_helper(int &maxw, int &maxh)
 */
 void QWidget::setMaximumSize(int maxw, int maxh)
 {
+    if (isWindow())
+        qDebug() << __FUNCTION__ << maxw << maxh << "size=" << size();
     Q_D(QWidget);
     if (!d->setMaximumSize_helper(maxw, maxh))
         return;
@@ -3721,6 +3723,8 @@ void QWidget::setMaximumSize(int maxw, int maxh)
         d->setConstraints_sys();
     if (maxw < width() || maxh < height()) {
         bool resized = testAttribute(Qt::WA_Resized);
+        if (isWindow())
+            qDebug()<< __FUNCTION__ << "resizing"  << resized;
         resize(qMin(maxw,width()), qMin(maxh,height()));
         setAttribute(Qt::WA_Resized, resized); //not a user resize
     }
@@ -6564,6 +6568,8 @@ void QWidget::resize(const QSize &s)
 {
     Q_D(QWidget);
     setAttribute(Qt::WA_Resized);
+    if (isWindow())
+        qDebug() << __FUNCTION__ << s << "created" <<testAttribute(Qt::WA_WState_Created);
     if (testAttribute(Qt::WA_WState_Created)) {
         d->fixPosIncludesFrame();
         d->setGeometry_sys(geometry().x(), geometry().y(), s.width(), s.height(), false);
@@ -7789,6 +7795,8 @@ void QWidget::adjustSize()
     if (d->layout)
         d->layout->activate();
 
+    if (isWindow())
+        qDebug() << __FUNCTION__ << s;
     if (s.isValid())
         resize(s);
 }
@@ -9479,7 +9487,11 @@ void QWidgetPrivate::updateGeometry_helper(bool forceUpdate)
 void QWidget::updateGeometry()
 {
     Q_D(QWidget);
+    if (isWindow())
+        qDebug() << __FUNCTION__ << '>' << this;
     d->updateGeometry_helper(false);
+    if (isWindow())
+        qDebug() << __FUNCTION__ << '<' << this;
 }
 
 /*! \property QWidget::windowFlags
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index e5f5526..34a9d65 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -700,6 +700,9 @@ void QWidgetPrivate::stackUnder_sys(QWidget*)
 void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
 {
     Q_Q(QWidget);
+    if (q->isWindow())
+        qDebug() << __FUNCTION__ << q << x << y << w << h << "isMove" <<isMove;
+
     if (extra) {                                // any size restrictions?
         w = qMin(w,extra->maxw);
         h = qMin(h,extra->maxh);
@@ -785,6 +788,8 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
         }
         if (isResize) {
             QResizeEvent e(r.size(), olds);
+            if (q->isWindow())
+                qDebug() << __FUNCTION__ << "sending" << &e;
             QApplication::sendEvent(q, &e);
             if (q->windowHandle())
                 q->update();
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 35a526e..9df427e 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -605,6 +605,11 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
     // If the widget's size already matches that of the event, this is a
     // result of call to QWidget::resize(), which already sends an event.
     const bool spontaneous = oldSize != event->size();
+    qDebug() << __FUNCTION__ << m_widget << "from size" << m_widget->size() << "/crect" << oldSize << "to" << event->size()
+                << "spontaneous" << spontaneous
+                << "Qt::WA_Resized" << m_widget->testAttribute(Qt::WA_Resized)
+                << "Qt::WA_PendingResizeEvent" << m_widget->testAttribute(Qt::WA_PendingResizeEvent)
+                << "visible" << m_widget->isVisible();
 
     updateGeometry();
     if (spontaneous)
