diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-04-12 21:32:05 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-04-18 18:11:14 +0000 |
commit | b773a4f5836b39e363899ad48a9f469e7f18db1a (patch) | |
tree | 620ec8061732d6186b9c0cb6d1291323f2133d4a /src/widgets | |
parent | f371f8a64dc76ec9ff07b666577b7ab47b69751d (diff) |
QStyleSheetStyle: Don't try to load a pixmap with an empty filename
QStyleSheetStyle::loadPixmap() might be called with an empty filename
but then it should not try to load a file with an empty filename.
Pick-to: 6.7 6.5
Fixes: QTBUG-123839
Change-Id: Ie01e9f75f025650b0802736bb589ebdc48e93696
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 7602217f24..655b224617 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -6512,6 +6512,9 @@ bool QStyleSheetStyle::isNaturalChild(const QObject *obj) QPixmap QStyleSheetStyle::loadPixmap(const QString &fileName, const QObject *context) { + if (fileName.isEmpty()) + return {}; + qreal ratio = -1.0; if (const QWidget *widget = qobject_cast<const QWidget *>(context)) { if (QScreen *screen = QApplication::screenAt(widget->mapToGlobal(QPoint(0, 0)))) |