# zhiyiyo/pyqt-fluent-widgets architecture

> Architecture diagram of the GitHub repository zhiyiyo/pyqt-fluent-widgets, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhiyiyo/pyqt-fluent-widgets
- Repository: https://github.com/zhiyiyo/pyqt-fluent-widgets

## Overview

##### Main Components
- Core Library (qfluentwidgets):
⁃ Multimedia: Modules like media_play_bar, media_player, video_widget.
⁃ Window: Modules like fluent_window, splash_screen, stacked_widget.
- Resource Module (qfluentwidgets/_rc):
- Examples:
- Another major part is the "examples" directory, which demonstrates how to use the library.
- Examples as clients of the core library, interacting with its various widgets.
- Documentation:
- CI/CD & Repository Support:
- Packaging & Setup:

##### Relationships & Interactions
- Each submodule within qfluentwidgets (e.g., common, components, multimedia, window) is an independent module that interacts with one another by following shared design patterns – such as the MVC separation intrinsic in designing UI control libraries.
- The Examples act as clients; they import and use widgets from the core modules, demonstrating component interactions in realistic scenarios.
- The Documentation system provides support information and guides on how to integrate and use the library; hence, it is loosely connected to all components.
- The CI/CD and packaging modules ensure that the code is properly built, tested, and distributed.

##### Architectural Patterns & Technologies
- Modular Design: The library is clearly divided into modules (common, components, multimedia, window) that are designed to be loosely coupled yet interdependent.
- Resource Bundling: A dedicated _rc module handles resources (images, styling files, internationalization), which is a common pattern in GUI applications.
- Underlying Technology: The library uses PyQt5 (or variants like PySide2, PySide6, or PyQt6) as its GUI framework. Also note the use of QSS (CSS for Qt) for theming and styling.
- Continuous Integration: The presence of GitHub workflows indicates automated testing and publishing pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Library and its Modules
    CoreLib["qfluentwidgets"]:::core
    C_Common["Common"]:::submodule
    C_ComponentsParent["Components"]:::submodule
    C_Multimedia["Multimedia"]:::submodule
    C_Window["Window (fluent_window, splash_screen, stacked_widget)"]:::submodule

    %% Subcomponents under Components
    C_DateTime["DateTime (calendar_picker, date_picker, time_picker)"]:::submodule
    C_DialogBox["Dialog Box (color_dialog, message_dialog, etc.)"]:::submodule
    C_Layout["Layout (expand_layout, flow_layout, v_box_layout)"]:::submodule
    C_Material["Material"]:::submodule
    C_Navigation["Navigation (breadcrumb, navigation_bar, navigation_panel, etc.)"]:::submodule
    C_Settings["Settings"]:::submodule
    C_Widgets["Widgets (button, check_box, card_widget, etc.)"]:::submodule

    %% External Components
    R["Resource Module (_rc)"]:::resource
    EX["Examples"]:::examples
    DOC["Documentation"]:::documentation
    CI_CD["CI/CD & Repo (.github)"]:::cicd
    P_Setup["setup.py"]:::packaging
    P_Req["requirements.txt"]:::packaging

    %% Relationships inside Core Library
    CoreLib --> C_Common
    CoreLib --> C_ComponentsParent
    CoreLib --> C_Multimedia
    CoreLib --> C_Window

    C_ComponentsParent --> C_DateTime
    C_ComponentsParent --> C_DialogBox
    C_ComponentsParent --> C_Layout
    C_ComponentsParent --> C_Material
    C_ComponentsParent --> C_Navigation
    C_ComponentsParent --> C_Settings
    C_ComponentsParent --> C_Widgets

    %% Relationships with External Components
    CoreLib -->|"uses"| R
    EX -->|"uses"| CoreLib
    DOC -->|"documents"| CoreLib
    CI_CD -->|"builds"| CoreLib
    P_Setup -->|"packages"| CoreLib
    P_Req -->|"packages"| CoreLib
    CI_CD -->|"automates"| P_Setup
    CI_CD -->|"automates"| P_Req

    %% Styles
    classDef core fill:#E1F5FE,stroke:#0277BD,stroke-width:2px;
    classDef submodule fill:#BBDEFB,stroke:#1565C0,stroke-width:2px;
    classDef resource fill:#FFF9C4,stroke:#F9A825,stroke-width:2px;
    classDef examples fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px;
    classDef documentation fill:#D1C4E9,stroke:#512DA8,stroke-width:2px;
    classDef cicd fill:#FFCDD2,stroke:#C62828,stroke-width:2px;
    classDef packaging fill:#FFE0B2,stroke:#EF6C00,stroke-width:2px;

    %% Click Events for Core Components
    click CoreLib "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/"
    click C_Common "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/common/"
    click C_ComponentsParent "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/"
    click C_DateTime "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/date_time/"
    click C_DialogBox "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/dialog_box/"
    click C_Layout "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/layout/"
    click C_Material "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/material/"
    click C_Navigation "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/navigation/"
    click C_Settings "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/settings/"
    click C_Widgets "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/components/widgets/"
    click C_Multimedia "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/multimedia/"
    click C_Window "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/window/"
    click R "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/qfluentwidgets/_rc/"
    click EX "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/examples/"
    click DOC "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/docs/"
    click CI_CD "https://github.com/zhiyiyo/pyqt-fluent-widgets/tree/master/.github/"
    click P_Setup "https://github.com/zhiyiyo/pyqt-fluent-widgets/blob/master/setup.py"
    click P_Req "https://github.com/zhiyiyo/pyqt-fluent-widgets/blob/master/requirements.txt"
```
