diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index b26567ad0c..d4ff54e127 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -759,6 +759,7 @@ static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked)
     QWindowPrivate *p = qt_window_private(window);
     if (p->blockedByModalWindow != shouldBeBlocked) {
         p->blockedByModalWindow = shouldBeBlocked;
+        qDebug() << __FUNCTION__ << window << "shouldBeBlocked=" << shouldBeBlocked;
         QEvent e(shouldBeBlocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked);
         QGuiApplication::sendEvent(window, &e);
         for (QObject *c : window->children()) {
@@ -787,6 +788,7 @@ static inline bool needsWindowBlockedEvent(const QWindow *w)
 void QGuiApplicationPrivate::showModalWindow(QWindow *modal)
 {
     self->modalWindowList.prepend(modal);
+    qDebug() << __FUNCTION__ << modal;
 
     // Send leave for currently entered window if it should be blocked
     if (currentMouseWindow && !QWindowPrivate::get(currentMouseWindow)->isPopup()) {
@@ -811,6 +813,7 @@ void QGuiApplicationPrivate::showModalWindow(QWindow *modal)
 
 void QGuiApplicationPrivate::hideModalWindow(QWindow *window)
 {
+    qDebug() << __FUNCTION__ << window;
     self->modalWindowList.removeAll(window);
 
     for (QWindow *window : qAsConst(QGuiApplicationPrivate::window_list)) {
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 26779f0c01..62e327bc9f 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -219,6 +219,7 @@ private:
 template <class BaseClass>
 void QWindowsDialogHelperBase<BaseClass>::cleanupThread()
 {
+    qDebug() << __FUNCTION__;
     if (m_thread) { // Thread may be running if the dialog failed to close.
         if (m_thread->isRunning())
             m_thread->wait(500);
@@ -233,6 +234,7 @@ void QWindowsDialogHelperBase<BaseClass>::cleanupThread()
         delete m_thread;
         m_thread = 0;
     }
+    qDebug() << __FUNCTION__ <<"done!";
 }
 
 template <class BaseClass>
@@ -390,11 +392,12 @@ void QWindowsDialogHelperBase<BaseClass>::hide()
 template <class BaseClass>
 void QWindowsDialogHelperBase<BaseClass>::exec()
 {
-    qCDebug(lcQpaDialogs) << __FUNCTION__;
+    qDebug() << __FUNCTION__;
     stopTimer();
     if (QWindowsNativeDialogBase *nd = nativeDialog()) {
          nd->exec(m_ownerWindow);
          m_nativeDialog.clear();
+         qDebug() << __FUNCTION__ << '<';
     }
 }
 
@@ -958,15 +961,17 @@ QString QWindowsNativeFileDialogBase::directory() const
 
 void QWindowsNativeFileDialogBase::doExec(HWND owner)
 {
-    qCDebug(lcQpaDialogs) << '>' << __FUNCTION__;
+    qDebug() << '>' << __FUNCTION__;
     // Show() blocks until the user closes the dialog, the dialog window
     // gets a WM_CLOSE or the parent window is destroyed.
     const HRESULT hr = m_fileDialog->Show(owner);
     QWindowsDialogs::eatMouseMove();
-    qCDebug(lcQpaDialogs) << '<' << __FUNCTION__ << " returns " << hex << hr;
+    qDebug() << '<' << __FUNCTION__ << " returns " << hex << hr;
     if (hr == S_OK) {
+        qDebug() << __FUNCTION__ << "emit a";
         emit accepted();
     } else {
+        qDebug() << __FUNCTION__ << "emit r";
         emit rejected();
     }
 }
@@ -1368,8 +1373,10 @@ static void cleanupTemporaryItemCopies()
 
 static QString createTemporaryItemCopy(QWindowsShellItem &qItem)
 {
-    if (!qItem.canCopy() || !qItem.canStream())
+    if (!qItem.canCopy() || !qItem.canStream()) {
+        qDebug() << __FUNCTION__ << "cs";
         return QString();
+    }
     QString pattern = qItem.normalDisplay();
     const int lastDot = pattern.lastIndexOf(QLatin1Char('.'));
     const QString placeHolder = QStringLiteral("_XXXXXX");
@@ -1426,6 +1433,7 @@ QList<QUrl> QWindowsNativeOpenFileDialog::selectedFiles() const
                 qWarning().nospace() << __FUNCTION__<< ": Unable to obtain URL of " << qItem;
         }
     }
+    qDebug() << __FUNCTION__ << result.size();
     return result;
 }
 
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index e60f62e4a5..db4b2c0bed 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -2456,6 +2456,7 @@ bool QWindowsWindow::isEnabled() const
 
 void QWindowsWindow::setEnabled(bool enabled)
 {
+    qDebug() << __FUNCTION__ << enabled;
     const unsigned oldStyle = style();
     unsigned newStyle = oldStyle;
     if (enabled) {
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index f5db4481ee..4384b8bb5e 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -472,6 +472,7 @@ int QDialog::result() const
 */
 void QDialog::setResult(int r)
 {
+    qDebug() << __FUNCTION__ << r;
     Q_D(QDialog);
     d->rescode = r;
 }
@@ -532,6 +533,7 @@ int QDialog::exec()
     d->resetModalitySetByOpen();
 
     bool wasShowModal = testAttribute(Qt::WA_ShowModal);
+    qDebug() << __FUNCTION__ << "wasShowModal=" <<wasShowModal;
     setAttribute(Qt::WA_ShowModal, true);
     setResult(0);
 
@@ -539,7 +541,9 @@ int QDialog::exec()
 
     QPointer<QDialog> guard = this;
     if (d->nativeDialogInUse) {
+        qDebug() << __FUNCTION__ << ">d->platformHelper()->exec()";
         d->platformHelper()->exec();
+        qDebug() << __FUNCTION__ << "<d->platformHelper()->exec()";
     } else {
         QEventLoop eventLoop;
         d->eventLoop = &eventLoop;
@@ -554,6 +558,7 @@ int QDialog::exec()
     int res = result();
     if (d->nativeDialogInUse)
         d->helperDone(static_cast<QDialog::DialogCode>(res), d->platformHelper());
+    qDebug() << __FUNCTION__ << res << "deleteOnClose=" << deleteOnClose;
     if (deleteOnClose)
         delete this;
     return res;
@@ -575,6 +580,7 @@ int QDialog::exec()
 
 void QDialog::done(int r)
 {
+    qDebug() << __FUNCTION__ << r;
     Q_D(QDialog);
     setResult(r);
     hide();
@@ -714,8 +720,11 @@ void QDialog::closeEvent(QCloseEvent *e)
 void QDialog::setVisible(bool visible)
 {
     Q_D(QDialog);
-    if (!testAttribute(Qt::WA_DontShowOnScreen) && d->canBeNativeDialog() && d->setNativeDialogVisible(visible))
+    qDebug() << __FUNCTION__ << visible;
+    if (!testAttribute(Qt::WA_DontShowOnScreen) && d->canBeNativeDialog() && d->setNativeDialogVisible(visible)) {
+        qDebug() << __FUNCTION__ << "bailout";
         return;
+    }
 
     if (visible) {
         if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 8d37969be4..3602d3e9ea 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -545,6 +545,7 @@ void QFileDialogPrivate::initHelper(QPlatformDialogHelper *h)
     QObject::connect(h, SIGNAL(filterSelected(QString)), d, SIGNAL(filterSelected(QString)));
     static_cast<QPlatformFileDialogHelper *>(h)->setOptions(options);
     nativeDialogInUse = true;
+    qDebug() << __FUNCTION__ <<                 nativeDialogInUse;
 }
 
 void QFileDialogPrivate::helperPrepareShow(QPlatformDialogHelper *)
@@ -558,11 +559,14 @@ void QFileDialogPrivate::helperPrepareShow(QPlatformDialogHelper *)
         options->setInitiallySelectedNameFilter(q->selectedNameFilter());
     if (options->initiallySelectedFiles().isEmpty())
         options->setInitiallySelectedFiles(userSelectedFiles());
+    qDebug() << __FUNCTION__ ;
 }
 
 void QFileDialogPrivate::helperDone(QDialog::DialogCode code, QPlatformDialogHelper *)
 {
+    qDebug() << __FUNCTION__ << code;
     if (code == QDialog::Accepted) {
+
         Q_Q(QFileDialog);
         q->setViewMode(static_cast<QFileDialog::ViewMode>(options->viewMode()));
         q->setSidebarUrls(options->sidebarUrls());
@@ -831,6 +835,7 @@ void QFileDialog::open(QObject *receiver, const char *member)
 */
 void QFileDialog::setVisible(bool visible)
 {
+    qDebug() << __FUNCTION__ << visible;
     Q_D(QFileDialog);
     if (visible){
         if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
@@ -865,6 +870,8 @@ void QFileDialog::setVisible(bool visible)
     if (visible && d->usingWidgets())
         d->qFileDialogUi->fileNameEdit->setFocus();
 
+    qDebug() << __FUNCTION__ << "bottom" << visible;
+
     QDialog::setVisible(visible);
 }
 
@@ -2601,7 +2608,9 @@ void QFileDialog::accept()
     Q_D(QFileDialog);
     if (!d->usingWidgets()) {
         const QList<QUrl> urls = selectedUrls();
+        qDebug() << __FUNCTION__ << "urls=" << urls.size();
         if (urls.isEmpty())
+
             return;
         d->_q_emitUrlsSelected(urls);
         if (urls.count() == 1)
