Creating a Modern Flat GUI for a Python Desktop App with Splash Screen using QT Designer, Pyqt, and Pyside

Posted by


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!

0 0 votes
Article Rating

Leave a Reply

18 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@SpinnTV
4 hours ago

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.

@qozia1370
4 hours ago

Why not use an image for the splash screen and save 30 minutes?
Good video though, thank you.

@mertcanbatur
4 hours ago

2:20 what did you do to "main_frame". i dont get it. can you please help me?

@adamkruk2492
4 hours ago

splash screen isn't showing when i run program, in sublime it says that everything is ok! Any solution?

@yarmik3d
4 hours ago

Парень явно перепутал десктоп разработку с веб разработкой)

@osama64jilani
4 hours ago

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.

@hansyolo9163
4 hours ago

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.

@carlosalbertoperezsantos7651
4 hours ago

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!!!

@automatizadormt4iqbyfsocie351
4 hours ago

thank you for sharing this amazing knowledge it will be so helpful for me

@neu_usagi4625
4 hours ago

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?

@ventiladorbueno1846
4 hours ago

Thanks 🙏

@christopherscotto8789
4 hours ago

i keep getting AttributeError:'Ui_MainWindow' object has no attribute 'setWindowFlags'. anyone know why i keep getting this

@MultiGIRIPRASAD
4 hours ago

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?

@funnyguyzz7103
4 hours ago

Please upload more videos like this!!

@funnyguyzz7103
4 hours ago

Awesome videos!!!!!

@shinichiakiragi5933
4 hours ago

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.

@nonamee9919
4 hours ago

Im not able to load the qrc file , says that module is not found while everything is on point . aAny solution for that ?

@unclej938
4 hours ago

Kumbe Ngereki alifanya kitu 💪

18
0
Would love your thoughts, please comment.x
()
x