Metadata-Version: 2.4
Name: qtmui
Version: 0.0.56
Summary: Python Desktop Application Development
Project-URL: Documentation, https://pyapp-kit.github.io/qtmui/
Project-URL: Source, https://github.com/pyapp-kit/qtmui
Project-URL: Tracker, https://github.com/pyapp-kit/qtmui/issues
Project-URL: Changelog, https://github.com/pyapp-kit/qtmui/blob/main/CHANGELOG.md
Author: SangPC
License: BSD 3-Clause License
License-File: LICENSE
Keywords: gui,pyqt,pyside,qt,qt components,qt flat ui,qt material ui,qt mui,qt range slider,qt widgets,qtmui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: Software Development :: Widget Sets
Requires-Python: >=3.9
Requires-Dist: markdown>=3.9
Requires-Dist: pyconify>=0.2.1
Requires-Dist: pygments>=2.4.0
Requires-Dist: pyside6>=6.9.2
Requires-Dist: pywin32>=308
Requires-Dist: qtpy>=2.4.0
Requires-Dist: typing-extensions>=4.12.0; python_version >= '3.13'
Requires-Dist: typing-extensions>=4.5.0
Provides-Extra: cmap
Requires-Dist: cmap>=0.2; extra == 'cmap'
Provides-Extra: font-fa5
Requires-Dist: fonticon-fontawesome5>=5.15.4; extra == 'font-fa5'
Provides-Extra: font-fa6
Requires-Dist: fonticon-fontawesome6>=6.4.0; extra == 'font-fa6'
Provides-Extra: font-mi6
Requires-Dist: fonticon-materialdesignicons6>=6.9.96; extra == 'font-mi6'
Provides-Extra: font-mi7
Requires-Dist: fonticon-materialdesignicons7>=7.2.96; extra == 'font-mi7'
Provides-Extra: iconify
Requires-Dist: pyconify>=0.1.4; extra == 'iconify'
Provides-Extra: pyqt5
Requires-Dist: pyqt5-qt5==5.15.2; (sys_platform == 'win32') and extra == 'pyqt5'
Requires-Dist: pyqt5-qt5>=5.15.16; (sys_platform != 'win32') and extra == 'pyqt5'
Requires-Dist: pyqt5>=5.15.10; extra == 'pyqt5'
Provides-Extra: pyqt6
Requires-Dist: pyqt6!=6.6,>=6.4.0; extra == 'pyqt6'
Requires-Dist: pyqt6!=6.6,>=6.7.0; (python_version >= '3.12') and extra == 'pyqt6'
Provides-Extra: pyside2
Requires-Dist: numpy<2,>=1.19; (python_version < '3.11') and extra == 'pyside2'
Requires-Dist: numpy<2,>=1.26; (python_version >= '3.11' and python_version < '3.13') and extra == 'pyside2'
Requires-Dist: pyside2>=5.15; extra == 'pyside2'
Provides-Extra: pyside6
Requires-Dist: pyside6!=6.5.0,!=6.5.1,!=6.6.2,>=6.4.0; extra == 'pyside6'
Requires-Dist: pyside6>=6.7.0; (python_version >= '3.12') and extra == 'pyside6'
Provides-Extra: quantity
Requires-Dist: pint>=0.21; extra == 'quantity'
Description-Content-Type: text/markdown

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:
```bash
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.