Table of Contents
π A lightweight, neatly structured cross-platform general utility library developed based on PySide6 & Python, bundling window management, widget encapsulation, style control and basic component toolkit. It is built for GUI rapid development, lightweight desktop application building and personalized component secondary development scenarios.
In daily PySide6 GUI development, developers often repeatedly write window creation, widget binding, position adjustment and color style code in different projects. Scattered custom components lack unified encapsulation, inconsistent calling styles lead to high adaptation costs, and most ready-made component frameworks are overly bloated or have strong coupling, which is not friendly for lightweight projects and beginners. There are few concise, decoupled and easy-to-expand basic GUI tool suites that integrate window control and common widgets. To solve these pain points, I developed this project, aiming to build a set of standardized, low-coupling and long-term maintainable basic GUI underlying tool library.
This project is highly suitable for being integrated into various PySide6 GUI development projects for the following reasons:
- Avoid repeated wheel-making for basic logic such as window initialization, widget binding and position setting, allowing developers to focus more on core business and interactive logic.
- Adopt unified coding specifications, consistent interface calling styles and standardized encapsulation logic, getting rid of the chaos caused by scattered custom widgets.
- Good cross-platform compatibility, running stably on Windows, Linux and macOS, adapting to common desktop development environments.
- Follow native PySide6 usage specifications, retain intuitive calling logic while encapsulating complex underlying operations, with high code readability, convenient for debugging, modification and later function iteration.
- Each functional module is decoupled from each other, supporting selective reference and use, without introducing excess redundant code, and will not increase project volume and runtime overhead.
- Rich built-in practical capabilities: window size locking/unlocking, position adjustment, dynamic widget binding, component show/hide, foreground/background color modification, text content management and other commonly used GUI functions, covering most demands of lightweight GUI development.
Certainly, this basic tool library is mainly oriented to conventional lightweight GUI scenarios and does not involve complex advanced functions such as high-customization controls, special animation effects and large-scale client architecture. I will keep maintaining and iterating the project later, continuously enrich component types, optimize underlying logic, fix compatibility problems, and expand more practical auxiliary functions according to actual development needs. All developers are welcome to star the project. You can put forward function suggestions and optimization ideas via Issues, and polish this lightweight GUI basic tool library together. Every use and feedback from users is the driving force for the continuous improvement of this project.
- β¨ Native PySide6 Based Implementation Developed relying on standard PySide6 APIs, compatible with mainstream Python versions, simple access and seamless integration into existing PySide6 projects.
- πͺ Full-Featured Window Management Support window title setting, size adjustment, position moving, one-click locking/unlocking window size, and provide native window object escape interface for secondary development.
- π§© Encapsulated Basic Widget System Complete encapsulation based on native QWidget and QLabel, integrate common operations such as component display/hide, position and size setting, forming a unified basic component system.
- π¨ Convenient Style Control Support dynamic acquisition and modification of component text content, foreground color and background color, simplify style operation code, and avoid repeated writing of style sheets.
- π Dynamic Widget Binding Realize dynamic creation and binding of widgets, unified management of component stack, flexible addition of multiple UI elements at runtime.
- π Cross-Platform Stable Operation Follow PySide6 cross-platform design ideas, no platform-specific code, all core functions run consistently on Windows / Linux / macOS.
- π¦ Module Decoupling & Flexible Quotation Window management and basic widget modules are completely decoupled, supporting independent introduction and separate use, matching different project development demands flexibly.
- π§Ή Clear Structure & Easy Expansion Hierarchical code design, clear function classification, reserved expansion interfaces, convenient for users to expand custom widgets and extend personalized functions on the existing framework.
- π― Lightweight & Low Overhead Focus on practical basic GUI capabilities, discard redundant complicated functions, occupy few system resources, and adapt to small tools, desktop gadgets and other lightweight projects.
- Personal daily PySide6 learning practice and small GUI tool development
- Rapid development of lightweight desktop gadgets and console auxiliary clients
- Simple desktop application construction that requires unified management of basic UI components
- Beginner's PySide6 programming learning and code standardization training
- Unify basic GUI underlying code of small and medium-sized projects to reduce repeated development
- Secondary development and function expansion based on basic encapsulated widgets
- Development of simple upper computer auxiliary interface and small interactive program
- Finishing and sorting of daily accumulated PySide6 basic GUI code snippets
Here is an example to run.
At first, please clone the repository on your local computer:
git clone https://github.com/FishgameStudio/oh-my-gui.gitPlease keep the copyright comments in the source ode file while using. if you modified our source code, please insert these lines into your code:
# Modified by [Your Name] [Modified Date]
# Changes: [Modified Content]To use the APIs of this project, please install them down:
pip install .And you can use the APIs:
import ohmygui.core as core
import ohmygui.widget as widget
import ohmygui.layout as layout
app = core.App()
window = core.Window("Horizontal Layout Example", (400, 200))
layout = layout.HorizentalLayout()
layout.add_widget(widget.Text("Hello"))
layout.add_spacing(20)
layout.add_widget(widget.Text("World"))
layout.add_stretch()
layout.add_widget(widget.Text("!"))
window.set_layout(layout)
window.show()
app.run()This project uses PySide6 as the GUI core dependency. Please ensure PySide6 is installed in your Python environment before running or building the project.
- v0.1.0: Core framework, basic widget, 1 exmaple
- v0.2.0: Basic layout, 3~5 examples, dialog module
- v0.3.0: Basic style control, QML support
- v0.4.0: Optimize layout, complex widgets
- v0.5.0: Fix most bugs, optimize performence, improve docs
- v0.9.0[RC Version]: freeze API
- v1.0.0[Official Stable Version]: launch on PyPI
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feat/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feat/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Nicola Grey - popxhxh@outlook.com
Project Link: https://github.com/FishgameStudio/oh-my-gui
Hope this lightweight UtilitiesLibrary can assist you in daily C++ development, simplify repetitive basic logic writing, and speed up your project construction efficiency.
Every star, fork and sincere feedback means a lot to me. You are warmly welcome to submit issues for bugs feedback and function suggestions, or send pull requests to participate in code optimization and function iteration, so as to polish and improve this utility library together.
If you find this project practical and helpful, donβt forget to hit Star and Fork. All valuable opinions and ideas are sincerely welcomed. Thank you very much for your support!
