Root Files Reference

.gitignore
# .gitignore
#
# Specifies intentionally untracked files to ignore.
#
# - docs/_build/: Sphinx documentation build output
# - **/__pycache__/: Python bytecode cache directories
# - build/: Application build output
# - dist/: Distribution packages

**/.vscode/
**/__pycache__/
docs/_build/
build/
dist/
.venv/
.readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
  os: ubuntu-24.04
  tools:
    python: "3.11"
  apt_packages:
    - default-jre
    - graphviz

# Build documentation in the "docs/" directory with Sphinx
sphinx:
   configuration: docs/conf.py

# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
   install:
   - requirements: venv_requirements.txt
        
build.bat
@echo off
REM filepath: c:\Users\bico\Desktop\PyQtQuick_Project_Template\build.bat

REM ==========================================
REM Build script for application and docs
REM Usage:
REM   build.bat           - build both app and docs
REM   build.bat --app     - build only the application
REM   build.bat --docs    - build only the documentation
REM   build.bat --help    - show this help message
REM ==========================================

setlocal

REM Show help
if "%1"=="--help" (
    echo Build script usage:
    echo   build.bat           - build both app and docs
    echo   build.bat --app     - build only the application
    echo   build.bat --docs    - build only the documentation
    echo   build.bat --help    - show this help message
    exit /b 0
)

REM Build only app
if "%1"=="--app" (
    echo Building application...
    pyinstaller main.spec
    exit /b %ERRORLEVEL%
)

REM Build only docs
if "%1"=="--docs" (
    echo Building documentation...
    sphinx-build -b html docs docs/_build
    exit /b %ERRORLEVEL%
)

REM Default: build both
echo Building documentation...
sphinx-build -b html docs docs/_build
if errorlevel 1 exit /b %ERRORLEVEL%

echo Building application...
pyinstaller main.spec
exit /b %ERRORLEVEL%
main.spec
# main.spec
#
# PyInstaller spec file for building the application.
#
# Usage:
#   pyinstaller main.spec
#
# This file defines how PyInstaller should bundle your Python application.
# For more information, see: https://pyinstaller.org/en/stable/spec-files.html

# -*- mode: python ; coding: utf-8 -*-

import sys, os
from cx_Freeze import Executable, setup  # (Optional: Only needed if using cx_Freeze features)

block_cipher = None  # Used for encrypting Python bytecode (optional)

# Analysis step:
# - 'src/main.py' is the entry point.
# - pathex: additional paths to search for imports.
# - binaries, datas: additional files to include.
# - hiddenimports: modules PyInstaller can't detect automatically.
# - excludes: modules to exclude.
a = Analysis(
    ['src/main.py'],
    pathex=[],
    binaries=[],
    datas=[],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False
)

# PYZ step: Packages Python modules into a .pyz archive.
pyz = PYZ(
    a.pure,
    a.zipped_data,
    cipher=block_cipher
)

# EXE step: Builds the final executable.
# - name: output executable name.
# - debug: include debug info.
# - upx: use UPX to compress the executable.
# - console: True for console app, False for windowed app.
exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name='main_app',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,
    disable_windowed_traceback=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None
)
# onefile ----------------------------------------------------------------
README.md
## Getting Started

### Clone the Repository

To clone this repository with all submodules:

```bash
git clone --recurse-submodules https://github.com/LinhTrucVo/PyQtQuick_Project_Template.git
cd PyQtQuick_Project_Template
```

If you already cloned the repository without submodules, initialize them:

```bash
git submodule update --init --recursive
```

or update them:

```bash
git submodule update --remote --recursive
```

After update submodule:

```bash
git add src/PyQtLib_Project_Template
git commit -m "updare submodule"
git push
```

## Submodules

This project uses the following submodules:

- **PyQtLib_Project_Template**: Core PyQt threading and messaging library
  - Repository: https://github.com/LinhTrucVo/PyQtLib_Project_Template.git
  - Path: `src/PyQtLib_Project_Template`

# OLD-------------------------------------------------------------

# 🚀 QtQuick Project Template

[![Documentation Status](https://readthedocs.org/projects/pyqtquick-project-template/badge/?version=latest)](https://pyqtquick-project-template.readthedocs.io/en/latest/?badge=latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A modern template for PyQtQuick/PySide6 projects with multi-threaded QML UI integration.

---

## 📚 Official Documentation

👉 [https://pyqtquick-project-template.readthedocs.io/](https://pyqtquick-project-template.readthedocs.io/)

---

## 🎨 QML Preview Tools

- [QmlSandbox - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=SavenkovIgor.QmlSandboxExtension)
  <img src="https://img.icons8.com/color/48/000000/visual-studio-code-2019.png" width="24" alt="VSCode Icon"/>
- [Online preview of Qt Framework](https://try.qt.io/)
- [qmlonline](https://patrickelectric.work/qmlonline/)
- [QML Online (VSCode Extension)](https://marketplace.visualstudio.com/items?itemName=SavenkovIgor.QmlSandboxExtension)

---

## 🛠️ Features

- PySide6/PyQtQuick project structure
- Multi-threaded QML UI integration
- Sphinx documentation with PlantUML support
- Ready for Read the Docs

---

## 📦 Quick Start

```sh
git clone https://github.com/LinhTrucVo/PyQtQuick_Project_Template.git
cd PyQtQuick_Project_Template
# python -m venv .venv
# .venv\Scripts\activate  # On Windows
conda create --name PyQtQuick_Project_Template_env python=3.11 -y
conda activate PyQtQuick_Project_Template_env
pip install -r venv_requirements.txt
build.bat

```

## Create Code

```sh
cd src/Client_Code
python ../lib/PyQtLib_Project_Template/tool/create_client_code.py
```
<img width="267" height="182" alt="image" src="https://github.com/user-attachments/assets/885496ec-484c-4872-a762-7ae00c5685a8" />

## generate_python_class_from_resource
```sh
cd src/resource
./generate_python_class_from_resource.bat
```