Commit ff49c564 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

QMessageBox: Try to pass window handle to QIcon::pixmap().


Try to find a window handle so that the pixmap matching the
device pixel ratio of the screen can be found.

Task-number: QTBUG-52622
Change-Id: Iccf3cea82065af5e055d3cd932cd0808b29b15dc
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@theqtcompany.com>
Showing with 11 additions and 2 deletions
...@@ -2677,8 +2677,17 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb ...@@ -2677,8 +2677,17 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
default: default:
break; break;
} }
if (!tmpIcon.isNull()) if (!tmpIcon.isNull()) {
return tmpIcon.pixmap(iconSize, iconSize); QWindow *window = Q_NULLPTR;
if (mb) {
window = mb->windowHandle();
if (!window) {
if (const QWidget *nativeParent = mb->nativeParentWidget())
window = nativeParent->windowHandle();
}
}
return tmpIcon.pixmap(window, QSize(iconSize, iconSize));
}
return QPixmap(); return QPixmap();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment