Custom widgets and widget animations made for QT applications
Project description
QT-PyQt-PySide-Custom-Widgets
Awesome custom widgets made for QT Desktop Applications. Simplify your UI development process. These widgets can be used in QT Designer then imported to PySide code.
Installation
First time installer:
pip install QT-PyQt-PySide-Custom-Widgets
Upgrade/install the latest version:
pip install --upgrade QT-PyQt-PySide-Custom-Widgets
Testing
The examples folder in this repository contains a few code examples you can use to test and learn about the custom widgets.
Gallery
What is new?
Version 0.7.3:
Qss stylesheet 'hot reload':
All changes made to your qss\scss\defaultStyle.scss
style sheet file will be recompiled and automatically applied to your app GUI, no need to restart the app when styling your GUI
-
You can apply this feature from your JSon style by adding
LiveCompileQss: true,
:"ShowLogs": true, "LiveCompileQss": true, "QMainWindow": [ {
-
you can also do this from your python file:
self.liveCompileQss = True #self = mainwindow
Version 0.6.9:
- New project structure:
To use version 0.6.9 or later, it's best to stick to the project structure outlined below. Alternatively, you can use the ProjectMake or project wizard
tool, which will set up your project with the same structure automatically.
project_name/
│
├── README.md
├── requirements.txt
├── main.py
│
├── ui/
│ ├── main_window.ui
│ └── ...
│
├── src/
│ ├── __init__.py
│ ├── utils.py
│ ├── helper_functions.py
│ └── ui_main_window.py # Automatically generated from main_window.ui
│
├── qss/
│ ├── scss/
│ │ ├── style.scss
│ │ └── ...
│ │
│ └── icons/
│ ├── icon1.png
│ └── ...
│
├── logs/
│ └── custom_widgets.log
│
├── json_styles/
│ ├── style.json
│ └── ...
│
└── generated-files/
├── new_files # Automatically generated by Custom Widgets
└── ...
Description:
- README.md: Description of the project.
- requirements.txt: List of Python dependencies required for the project.
- main.py: Entry point of the application.
- ui/: Directory containing UI-related files.
- main_window.ui: Main window layout file.
- Other UI-related files.
- src/: Source code directory.
- __init__.py: Package initialization file.
- utils.py: Utility functions.
- helper_functions.py: Additional helper functions.
- ui_main_window.py: Automatically generated Python code from main_window.ui.
- qss/: Directory for Qt Style Sheets (QSS) and icons.
- scss/: SCSS files for styling.
- icons/: Icon images.
- logs/: Directory for log files.
- custom_widgets.log: Log file.
- json_styles/: Directory for JSON style files.
- style.json: Example JSON style file.
- generated-files/: Directory for files auto-generated by the custom widgets module.
- Example generated files include UI's and JSon files
This structure allows for automatic conversion of UI files to Python code and placement within the src folder, simplifying the development process for users.
- Quick theme engine.
- Applies new icons on theme change without need to restart your app.
- Faster theme/icons switching.
- The custom widgets module comes with its own icon sets:
- Feather
- FontAwesome
- and Google material design icons.
- New custom widgets
logs
.
- Log file is located inside the "Logs" folder.
- Quick
CMD/Terminal
commands:
- To launch
ProjectMaker / project wizard
, run
Custom_Widgets --create-project
This will create a Qt-python
project inside your empty folder, ready to run.
- Easy to convert UI files to py. The cutom widgets
Theme Engine
eliminated the need forQRC
topython
file conversion, therefore to generateUI-Python
files without any errors, use
Custom_Widgets --convert-ui ui-path --qt-library your-lib
- Monitor changes made to UI file and generate new .py file and other necessary files for the custom widgets
Custom_Widgets --monitor-ui ui-path --qt-library your-lib
Where: ui-path
is the UI file path or folder containing UI files.
your-lib
is PySide6
, PySide2
, PyQt5
or PyQt6
Updating old GUI app to work with the current Custom Widgets module update
Version 0.6.2:
-
Added support for loading multiple
JSON Stylesheets
By default, the json file namedstyle.json
will be loaded, so no need to specify. The file must me inside the root directory of your project,json
directory, orjsonstyles
directory inside your project folder for it to be automatically loaded.If you have multiple JSON stylesheet files, then you can apply them to your GUI like this:
######################################################################## # APPLY JSON STYLESHEET ######################################################################## # self = QMainWindow class # self.ui = Ui_MainWindow / user interface class loadJsonStyle(self, self.ui, jsonFiles = { "mystyle.json", "mydirectory/myJsonStyle.json" }) ########################################################################
This feature is helpful especially when you have multiple windows files that will share only some parts of the stylesheet shuch app app title, settings etc.
-
Toggle logs: You can now switch app logs on or off. This can be done from a python file:
# Show Logs self.showCustomWidgetsLogs = True
# Hide Logs self.showCustomWidgetsLogs = False
From the JSON file:
{ "ShowLogs": true,
{ "ShowLogs": false,
Version 0.6.8:
- Added full support for
pyside6
How to use it.
Please read the required project structure above before proceeding.
Documentation:
-
Available custom widgets:
AnalogGaugeWidget
- A digital analog widget using just a singleQWidget
. Read moreQCustomCheckBox
- Customize and animateQCheckBox
. Read moreQCustomProgressIndicator
- Create a beautiful modern progress indicator for multiple tasks. Read moreQCustomQPushButton
- Customize and animateQPushButton
with preset themes and useiconify
to animate the icons. Read moreQCustomQSlider
- Easily move the slider to the current clicked position of aQSlider
. Read moreQCustomQStackedWidget
- Add beautiful transition animations and navigate throughQStackedWidget
. Read moreQCustomSlideMenu
- Expand and collapse the size of yourQWidgets
i.e side menu, popup notifications, floating widgets etc. Read moreQMainWindow
- Apply custom window title bar and navigation. Read more
-
Other extra functions:
ProjectMaker / project wizard
- Used for creating aQt-Python
project on an empty folder. Read moreQCards
- Apply the same syle iedrop-shadow effect
to a group ofQFrame
,QWidget
etc. Best for creating dashboard cards. Read moreQCustomQPushButtonGroup
- Create a group ofQPushButton
s with differentstylesheet
s for the currentactive
orclicked
button and other innactive buttons. Read moreQt Theme Engine
- Beautify your app. This feature will create multiple themes for QT for Python apps. Read moreQSettings
- Easily save your app configurations that will be remembered even after restarting the app ie app theme from Qt Theme Engine`. Watch the tutorial
-
Or watch the tutorial videos here
Support 💖
If you find this project valuable and would like to contribute to its development and maintenance, you can support me on Patreon. Your sponsorship means a lot and is greatly appreciated!💖
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for QT-PyQt-PySide-Custom-Widgets-0.7.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59daa2b1c6478eea75a7521922f046e25c1166a2e573bd9074c6e7c297fe9bf8 |
|
MD5 | a30bfffe96f3b1ed10dafd96f0b84f48 |
|
BLAKE2b-256 | a7a887fa0d418c22adebdadbcb685853630ef00feabe5ee4397187dccaa2a062 |
Hashes for QT_PyQt_PySide_Custom_Widgets-0.7.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 792160df97790cdfad73ff2829e9d1a27437d2fcc2b09b91353231adcca3f49f |
|
MD5 | 063c267f42a80051678f99ba1ebed2b1 |
|
BLAKE2b-256 | 9c2dc2c6f24dc1c5bca67138ac7bcc6d4d12ae5b8989d1f2510ab5fcf5652cd4 |