Python Desktop Application Development
Project description
QtMui Framework Introduction QtMui is a powerful Python framework built on top of PySide6, designed to bring the full power of React and Material-UI (MUI) to desktop application development. Inspired by the component-based architecture and styling flexibility of MUI (https://mui.com), QtMui provides a comprehensive suite of UI components, hooks, state management, and form handling utilities. It enables developers to create modern, responsive, and cross-platform desktop applications with a declarative, React-like API. With official support at https://qtmui.com, QtMui is the go-to solution for building scalable, professional-grade desktop UIs. Features
Comprehensive Component Library: A complete set of Material-UI-inspired components, including Box, Button, TextField, Grid, Typography, and more, designed for flexibility and ease of use. React-Inspired Hooks: Includes hooks like useState, useEffect, useResponsive, and others to manage state, side effects, and responsive layouts in a declarative manner. State Management with Redux: Integrated Redux support for centralized, predictable state management across complex applications. Form Handling and Validation: Robust form management with hookform and formvalidate, enabling seamless form creation and validation. Responsive Design: Built-in utilities like useResponsive and flexible layout components for creating adaptive UIs across different screen sizes. Customizable Styling: Supports inline sx prop styling (MUI-like) and QSS (Qt Style Sheets) for advanced, themeable designs. Type-Safe Development: Leverages Python’s type hints and optional static type checking for robust, maintainable codebases. Cross-Platform: Powered by PySide6, ensuring compatibility with Windows, macOS, and Linux. Theming Support: Create and apply custom themes to maintain consistent styling across your application.
Installation To get started with QtMui, ensure you have Python 3.8+ installed. Install QtMui and its dependencies using pip:
pip install qtmui
Getting Started Below is an example demonstrating QtMui’s component-based architecture, hooks, and Redux integration: import sys from qtmui.material.qtmui_app import QtMuiApp from qtmui.material.window import QtMuiWindow from qtmui.material.box import Box from qtmui.material.button import Button from qtmui.hooks import useState from qtmui.redux import create_store, useSelector, useDispatch
Define a simple Redux store
def counter_reducer(state=0, action=None): if action["type"] == "INCREMENT": return state + 1 return state
store = create_store(counter_reducer)
class MainWindow(QtMuiWindow): def init(self): super().init() self.setCentralWidget(CounterApp())
class CounterApp: def init(self): self.count, self.set_count = useState(0) self.dispatch = useDispatch()
def render(self):
count = useSelector(lambda state: state)
return Box(
direction="column",
spacing=10,
sx={"padding": 20},
children=[
Box(sx={"font-size": 20}, children=f"Count: {count}"),
Button(
children="Increment",
on_click=lambda: self.dispatch({"type": "INCREMENT"}),
sx={"background-color": "blue", "color": "white"}
)
]
)
if name == "main": app = QtMuiApp(sys.argv) window = MainWindow() window.show() sys.exit(app.exec())
This example showcases a counter app using useState, Redux, and the Box and Button components, demonstrating QtMui’s declarative and reactive capabilities. Key Components QtMui offers a full suite of components inspired by Material-UI, including but not limited to:
Box: A flexible container for layout management with support for direction, spacing, and custom styling. Button: A customizable button with variants, colors, and event handling. TextField: An input component with form validation support. Grid: A responsive grid system for complex layouts. Typography: A component for styled text with customizable fonts and sizes.
Explore the full component library at https://qtmui.com/docs/components. Hooks QtMui provides a rich set of hooks to manage state, side effects, and responsive behavior:
useState: Manage local component state. useEffect: Handle side effects like data fetching or DOM updates. useResponsive: Access screen size and device information for responsive design. useSelector/useDispatch: Integrate with Redux for global state management.
Learn more about hooks at https://qtmui.com/docs/hooks. Form Handling QtMui’s hookform and formvalidate utilities simplify form creation and validation: from qtmui.material.hookform import useForm from qtmui.material.text_field import TextField
def FormExample(): form = useForm({"name": ""}, {"name": {"required": True, "minLength": 3}}) return Box( children=[ TextField( name="name", label="Name", form=form, sx={"width": 200} ), Button( children="Submit", on_click=form.submit, sx={"margin-top": 10} ) ] )
This example demonstrates a simple form with validation, powered by hookform. Styling and Theming QtMui supports both inline sx styling and global QSS theming. Example of inline styling: Box(sx={"background-color": "blue", "border-radius": 5, "padding": 10})
For global theming, define a QSS function: from qtmui.material.styles.create_theme.theme_reducer import ThemeState
def theme_styles(_theme) -> dict: theme: ThemeState = _theme return { "PyBox": { "styles": { "root": {"backgroundColor": "transparent", "color": theme.palette.text.primary} } } }
Visit https://qtmui.com/docs/styling for detailed theming guides. Redux Integration QtMui seamlessly integrates with Redux for global state management. Define reducers and use hooks like useSelector and useDispatch to interact with the store, as shown in the Getting Started example. Contributing We welcome contributions to QtMui! To contribute:
Fork the repository at https://github.com/qtmui/qtmui. Create a new branch for your feature or bug fix. Submit a pull request with a clear description of your changes.
Please adhere to our coding standards and include tests where applicable. Check our contribution guidelines at https://qtmui.com/docs/contributing. License QtMui is licensed under the MIT License. See the LICENSE file for details. Contact For support, feedback, or inquiries, visit https://qtmui.com/support or file an issue at https://github.com/qtmui/qtmui/issues. Join our community discussions to connect with other developers. Learn More Explore the full documentation, tutorials, and API reference at https://qtmui.com to unlock the full potential of QtMui.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qtmui-0.0.33.tar.gz.
File metadata
- Download URL: qtmui-0.0.33.tar.gz
- Upload date:
- Size: 23.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b2b951978b0d4c8676ff25b1fa5abbfb674944a4a4d82f49eae788263de7692
|
|
| MD5 |
75065a5e8cfc902dc7d26cc685481b7d
|
|
| BLAKE2b-256 |
222dce42261211cc4a00ac285a2c8e9a6d0baa5ef20619c6c381d36d7d996795
|
File details
Details for the file qtmui-0.0.33-py3-none-any.whl.
File metadata
- Download URL: qtmui-0.0.33-py3-none-any.whl
- Upload date:
- Size: 23.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3b460a240c96edae73628ecefa3be6f1b3bebd51ae01a11954fd0f8d9222dfa
|
|
| MD5 |
edaff8fe0dbc0f9590cc1678b58e221b
|
|
| BLAKE2b-256 |
6632d20014f058e666f34ab4d675d0ae0444db90488ab81e2882f8fcdf072ffa
|