-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.11.1
-
None
-
Windows
QSplashScreen does not work with qrc URLs/fileames.
Problem: QSplashScreen creates a 160x160 grey square.
Reproduce:
Create a simple empty qml app, add an image to the project and create the splashscreen:
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QSplashScreen>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QString splashScreen{"qrc:/images/Splash.png"};
QPixmap pixmap(splashScreen);
QSplashScreen splash;
splash.setPixmap(pixmap);
splash.show();
app.processEvents();
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
On Mac it seems to show nothing at all.
the same filename formatted without the "qrc" works. eg. :/images/Splash.png.