In this tutorial, we will be creating a Python desktop application with a splash screen using QT Designer, PyQt or PySide, and a modern flat GUI design. Splash screens are a great way to give users a preview of your application while it loads its components in the background.
To start, you will need to have Python installed on your system along with PyQt or PySide. If you don’t have PyQt or PySide installed, you can install them using pip:
pip install PyQt5
or
pip install PySide2
Then, you will also need QT Designer, which is a GUI design tool for creating Qt-based applications. You can download QT Designer from the official Qt website or install it using pip:
pip install pyqt-tools
Once you have everything installed, we can start creating our Python desktop application with a splash screen.
Step 1: Designing the Splash Screen in QT Designer
Open QT Designer and create a new dialog-based GUI application. Design your splash screen by adding labels, images, and any other elements you want to display. You can customize the layout, colors, and fonts to your liking to create a modern flat GUI design.
Step 2: Converting the .ui file to Python code
Save your design as a .ui file. To convert the .ui file to Python code, you can use the pyuic tool that comes with PyQt or PySide. Run the following command in the terminal:
pyuic5 -x splash_screen.ui -o splash_screen.py
Step 3: Adding functionality to the splash screen
Now that we have our splash screen design converted to Python code, we can start adding functionality to it. In the main application file, import the generated splash screen code and create a new class that inherits from QMainWindow:
from PyQt5.QtWidgets import QMainWindow
from splash_screen import Ui_SplashScreen
class SplashScreen(QMainWindow, Ui_SplashScreen):
def __init__(self):
super().__init__()
self.setupUi(self)
# Add any additional functionality here
Step 4: Running the splash screen
In your main script, create an instance of the SplashScreen class and show it using the show() method. You can also set a timer to close the splash screen after a certain amount of time:
import sys
from PyQt5.QtWidgets import QApplication
from splash_screen import SplashScreen
app = QApplication(sys.argv)
splash_screen = SplashScreen()
splash_screen.show()
# Close the splash screen after 3 seconds
QtCore.QTimer.singleShot(3000, splash_screen.close)
sys.exit(app.exec_())
And that’s it! You now have a Python desktop application with a splash screen using QT Designer, PyQt or PySide, and a modern flat GUI design. You can further customize and expand your application by adding more features and functionality to it.
I hope this tutorial was helpful in guiding you through creating a splash screen for your Python desktop application. Let me know if you have any questions or need further assistance. Happy coding!
We are going to build a full pyton GUI desktop app one component at a time. Subscribe so that you wont miss out this cool tutorial.
Why not use an image for the splash screen and save 30 minutes?
Good video though, thank you.
2:20 what did you do to "main_frame". i dont get it. can you please help me?
splash screen isn't showing when i run program, in sublime it says that everything is ok! Any solution?
Парень явно перепутал десктоп разработку с веб разработкой)
Hi, Great tutorial. I was having trouble while running the code. It gives me an error saying "import Imgs_rc
ModuleNotFoundError: No module named 'Imgs_rc". Please help. Thanks alot.
hey what are the other imports at the top of nike_splash.py cant see them in the video and the link in the description is broken.
Hola, saludos desde México! ¿Qué pasos debo seguir para poder ver el código de Python? Actualmente, no me sale como a ti. Me marca que no existe el archivo en ………../bin/uic.
Muchas gracias!!!
thank you for sharing this amazing knowledge it will be so helpful for me
Hello, I am new to learning Qt. As a designer do you think I can use Qt designer without the knowledge of coding? Is coding really necessary for Qt?
Thanks 🙏
i keep getting AttributeError:'Ui_MainWindow' object has no attribute 'setWindowFlags'. anyone know why i keep getting this
Thank you for the videos. I need a help. I have created a main frame and filled it with image without any colors. Same way I have used "more info frame". While I run the program image is not visible and only "more info frame" is visible that too with shrinked text sizes. Can you help?
Please upload more videos like this!!
Awesome videos!!!!!
My sincere appreciation to you.
Even there are some steps seem little magic, but most of manipulations are obvious and easy to do. Further, I suggest that you can choose light theme for clearer presentation.
Anyway, this is the most awesome Qt tutorial I have ever found out.
Thank you very much! Hope you release more and more wonderful videos.
Wish your channel to grow large.
Im not able to load the qrc file , says that module is not found while everything is on point . aAny solution for that ?
Kumbe Ngereki alifanya kitu 💪