Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69691

QSplashScreen/Pixmap does not work with qrc:/ paths

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.11.1
    • None
    • Windows
    • Windows

    Description

      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.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            chehrlic Christian Ehrlicher
            Dynite Michael Cox
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes