You must scale pixmap to screen size using QPixmap :: scaled () . You can get the screen resolution by calling QDesktopWidget :: screenGeometry () . The desktop widget is available from QApplication :: desktop () .
You can try something like this:
QDesktopWidget* desktopWidget = qApp->desktop(); QRect screenGeometry = desktopWidget->screenGeometry(); int screenWidth = screenGeometry.width(); int screenHeight = screenGeometry.height(); QPixmap pixmapForSplash = yourPixmap.scaled(screenWidth, screenHeight); QSplashScreen splashScreen(pixmapForSplash);
(Sorry, I cannot verify this because I do not have a development environment on this computer ... I hope this is correct.)
source share