diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp
index 8a8ee2a..0143b5d 100644
--- a/examples/widgets/dialogs/standarddialogs/main.cpp
+++ b/examples/widgets/dialogs/standarddialogs/main.cpp
@@ -49,6 +49,7 @@
 
 int main(int argc, char *argv[])
 {
+    QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
     QApplication app(argc, argv);
     QGuiApplication::setApplicationDisplayName(Dialog::tr("Standard Dialogs"));
 
diff --git a/examples/widgets/dialogs/standarddialogs/standarddialogs.pro b/examples/widgets/dialogs/standarddialogs/standarddialogs.pro
index 12a814c..05de9c6 100644
--- a/examples/widgets/dialogs/standarddialogs/standarddialogs.pro
+++ b/examples/widgets/dialogs/standarddialogs/standarddialogs.pro
@@ -1,5 +1,5 @@
 QT += widgets
-
+CONFIG+=console
 HEADERS       = dialog.h
 SOURCES       = dialog.cpp \
                 main.cpp
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index d9e1347..ca7bee2 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -833,6 +833,7 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state
         return QPixmap();
 
     qreal devicePixelRatio = qt_effective_device_pixel_ratio(window);
+    qDebug() <<  __FUNCTION__ << window << devicePixelRatio  << "reqSize=" << size;
 
     // Handle the simple normal-dpi case:
     if (!(devicePixelRatio > 1.0))
@@ -840,7 +841,11 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state
 
     // Try get a pixmap that is big enough to be displayed at device pixel resolution.
     QPixmap pixmap = d->engine->pixmap(size * devicePixelRatio, mode, state);
-    pixmap.setDevicePixelRatio(d->pixmapDevicePixelRatio(devicePixelRatio, size, pixmap.size()));
+    const qreal pdpr = d->pixmapDevicePixelRatio(devicePixelRatio, size, pixmap.size());
+    qDebug() <<  __FUNCTION__ << "obtained" <<pixmap << "for"
+              << (size * devicePixelRatio)
+              << "setting" << pdpr << "on it";
+    pixmap.setDevicePixelRatio(pdpr);
     return pixmap;
 }
 
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index ef652e6..0d900a1 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -505,6 +505,18 @@ static QPixmap loadIconFromShell32(int resourceId, QSizeF size)
 
 QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) const
 {
+    qDebug() << __FUNCTION__ << '>' << sp << size;
+    QPixmap r= standardPixmapI(sp, size);
+    qDebug() << __FUNCTION__ << '<' << sp << size <<"returns" << r;
+    if (qEnvironmentVariableIsSet("WRITE")) {
+        QString fn =  QLatin1String("pix") + QString::number(sp) + QLatin1Char('_')
+                + QString::number(qAbs(size.width())) + QLatin1String(".png");
+        qDebug() << "wrote" << fn << r.save(fn);
+    }
+    return r;
+}
+QPixmap QWindowsTheme::standardPixmapI(StandardPixmap sp, const QSizeF &size) const
+{
     const QScreen *primaryScreen = QGuiApplication::primaryScreen();
     const int scaleFactor = primaryScreen ? qRound(QHighDpiScaling::factor(primaryScreen)) : 1;
     const QSizeF pixmapSize = size * scaleFactor;
@@ -590,6 +602,7 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) con
 
     if (resourceId != -1) {
         QPixmap pixmap = loadIconFromShell32(resourceId, pixmapSize);
+        qDebug() << __FUNCTION__ << "obtained" << pixmap << "for resource" << resourceId << pixmapSize;
         if (!pixmap.isNull()) {
             if (sp == FileLinkIcon || sp == DirLinkIcon || sp == DirLinkOpenIcon) {
                 QPainter painter(&pixmap);
@@ -604,12 +617,14 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &size) con
     if (iconName) {
         HICON iconHandle = LoadIcon(NULL, iconName);
         QPixmap pixmap = qt_pixmapFromWinHICON(iconHandle);
+        qDebug() << __FUNCTION__ << "obtained" << pixmap << "from icon handle" << iconHandle;
         pixmap.setDevicePixelRatio(scaleFactor);
         DestroyIcon(iconHandle);
         if (!pixmap.isNull())
             return pixmap;
     }
 
+    qDebug() << __FUNCTION__ << "FALLTHROUGH!";
     return QPlatformTheme::standardPixmap(sp, size);
 }
 
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index cacde98..88206cd 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -58,6 +58,7 @@ public:
         { return m_fonts[type]; }
 
     QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const Q_DECL_OVERRIDE;
+    QPixmap standardPixmapI(StandardPixmap sp, const QSizeF &size) const;
     QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
                            QPlatformTheme::IconOptions iconOptions = 0) const Q_DECL_OVERRIDE;
 
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 8375624..a79fa19 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -303,6 +303,7 @@ void QMessageBoxPrivate::setupLayout()
     if (hasIcon)
         grid->addWidget(iconLabel, 0, 0, 2, 1, Qt::AlignTop);
     iconLabel->setVisible(hasIcon);
+    qDebug() << __FUNCTION__ << "iconLabel sh" << iconLabel->sizeHint() << "size=" << iconLabel->size();
 #ifdef Q_OS_MAC
     QSpacerItem *indentSpacer = new QSpacerItem(14, 1, QSizePolicy::Fixed, QSizePolicy::Fixed);
 #else
@@ -1268,6 +1269,7 @@ QMessageBox::Icon QMessageBox::icon() const
 void QMessageBox::setIcon(Icon icon)
 {
     Q_D(QMessageBox);
+    qDebug() << __FUNCTION__ << icon;
     setIconPixmap(QMessageBoxPrivate::standardIcon((QMessageBox::Icon)icon,
                                                    this));
     d->icon = icon;
@@ -1296,7 +1298,10 @@ QPixmap QMessageBox::iconPixmap() const
 void QMessageBox::setIconPixmap(const QPixmap &pixmap)
 {
     Q_D(QMessageBox);
+    qDebug() << __FUNCTION__ << pixmap;
     d->iconLabel->setPixmap(pixmap);
+qDebug() <<     "iconLSize" << d->iconLabel->size()
+             << d->iconLabel->devicePixelRatio();
     d->icon = NoIcon;
     d->setupLayout();
 }
@@ -1827,6 +1832,7 @@ void QMessageBox::about(QWidget *parent, const QString &title, const QString &te
     msgBox->setAttribute(Qt::WA_DeleteOnClose);
     QIcon icon = msgBox->windowIcon();
     QSize size = icon.actualSize(QSize(64, 64));
+    qDebug() << __FUNCTION__ << icon << size;
     msgBox->setIconPixmap(icon.pixmap(size));
 
     // should perhaps be a style hint
@@ -2677,8 +2683,21 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
     default:
         break;
     }
-    if (!tmpIcon.isNull())
-        return tmpIcon.pixmap(iconSize, iconSize);
+qDebug() <<     iconSize << tmpIcon;
+    if (!tmpIcon.isNull()) {
+        QWindow *window = Q_NULLPTR;
+        if (mb) {
+            window = mb->windowHandle();
+            if (!window) {
+                if (const QWidget *nativeParent = mb->nativeParentWidget())
+                    window = nativeParent->windowHandle();
+            }
+        }
+        qDebug() << "win=" << window
+                 << tmpIcon.pixmap(window, QSize(iconSize, iconSize));
+        return tmpIcon.pixmap(window, QSize(iconSize, iconSize));
+    }
+
     return QPixmap();
 }
 
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index a07a964..bbd349e 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -1109,6 +1109,7 @@ void QLabel::paintEvent(QPaintEvent *)
         opt.initFrom(this);
         if (!isEnabled())
             pix = style->generatedIconPixmap(QIcon::Disabled, pix, &opt);
+        qDebug() << __FUNCTION__  << pix << cr;
         style->drawItemPixmap(&painter, cr, align, pix);
     }
 }
