splashHeight = 150 splashLabel = QLabel() splashLabel.setPixmap(splashPic) splashLabel.setScaledContents(True) splashLabel.setMaximumSize(QSize(splashWidth, splashHeight)) splashLabel.setMinimumSize(QSize(splashWidth, splashHeight)) splash = QSplashScreen() splashLayout = QVBoxLayout() splashLayout.setContentsMargins(0, 0, 0, 0) splashLayout.setSpacing(0) splashLayout.addWidget(splashLabel) splashProgressBar = QProgressBar() splashProgressBar.setMaximumSize(QSize(splashWidth, 20)) splashProgressBar.setMinimumSize(QSize(splashWidth, 20)) splashLayout.addWidget(splashProgressBar) splash.setLayout(splashLayout) x = (screenGeometry.width() - splashLabel.width()) / 2 y = (screenGeometry.height() - splashLabel.height()) / 2 splash.move(x, y) splash.show() import matplotlib splashProgressBar.setValue(20) matplotlib.use('Qt5agg') splashProgressBar.setValue(40) from matplotlib import rcParams splashProgressBar.setValue(60) rcParams['figure.dpi'] = 80 splashProgressBar.setValue(80) from VisualPIC.Views.mainWindow import MainWindow splashProgressBar.setValue(100)