diff options
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index ef9be8f..c039ca8 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -830,15 +830,17 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; QFileInfo info(fileName); - if (!info.exists()) - return false; - QString key = QLatin1Literal("qt_pixmap") % info.absoluteFilePath() % HexString<uint>(info.lastModified().toTime_t()) % HexString<quint64>(info.size()) % HexString<uint>(data ? data->pixelType() : QPixmapData::PixmapType); + // Note: If no extension is provided, we try to match the + // file against known plugin extensions + if (!info.completeSuffix().isEmpty() && !info.exists()) + return false; + if (QPixmapCache::find(key, *this)) return true; |