From 47e5cd2432218d27cf778ee4e57c55c387774aab Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 29 Oct 2024 22:40:23 -0700 Subject: [PATCH] Qt: Fix "QFSFileEngine::open: No file name specified" warning --- src/platform/qt/Window.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index ddf34f4f9..8dca02078 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1086,7 +1086,12 @@ void Window::reloadDisplayDriver() { m_display->setMinimumSize(GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS); #endif - m_display->setBackgroundImage(QImage{m_config->getOption("backgroundImage")}); + QString backgroundImage = m_config->getOption("backgroundImage"); + if (backgroundImage.isEmpty()) { + m_display->setBackgroundImage(QImage{}); + } else { + m_display->setBackgroundImage(QImage{backgroundImage}); + } if (!proxy) { proxy = std::make_shared(); @@ -1978,7 +1983,12 @@ void Window::setupOptions() { ConfigOption* backgroundImage = m_config->addOption("backgroundImage"); backgroundImage->connect([this](const QVariant& value) { if (m_display) { - m_display->setBackgroundImage(QImage{value.toString()}); + QString backgroundImage = value.toString(); + if (backgroundImage.isEmpty()) { + m_display->setBackgroundImage(QImage{}); + } else { + m_display->setBackgroundImage(QImage{backgroundImage}); + } } }, this); m_config->updateOption("backgroundImage");