I built and executed the application (code bellow), and the splash screen shows gray, instead of the image. I didn't know where is the problem although the path of the image is correct.
This is my main.cpp:
#include <QApplication>
#include<QSplashScreen>
#include "mainwindow.h"
#include <unistd.h>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QPixmap pixmap(":/images/splash.png");
QSplashScreen splash(pixmap);
splash.setMask(pixmap.mask());
splash.show();
app.processEvents();
sleep(5);
MainWindow window;
window.show();
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
splash.finish(&window);
return app.exec();
}
There are two options :
As I said, try to use an image from a disk. If it displays fine, then it is one of the above problem.