Skip to main content

EasyUI - Qt UI 双向同步中间件

Project description

EasyUI - Qt UI 双向同步中间件

License: MIT Python Version

EasyUI 是一个基于 PySide6 的 Qt UI 双向同步中间件,支持 .py 和 .ui 文件的实时双向同步,让您的 UI 开发更加高效。

功能特性

  • 🔄 实时双向同步:自动监听 .py 和 .ui 文件变化,实时双向转换
  • 🎨 Qt Designer 集成:一键打开 Qt Designer 编辑 UI 文件
  • 📦 全局命令行工具:安装后可在任意目录使用 easyui 命令
  • 🔧 后台服务:使用线程在后台运行,不阻塞终端
  • 💻 跨平台支持:支持 Windows、macOS 和 Linux

安装

使用 pip 安装

pip install easyui-pyside6

从源码安装

# 克隆仓库
git clone https://gitee.com/yourusername/easyui.git
cd easyui

# 安装依赖
pip install -r requirements.txt

# 安装包
pip install -e .

快速开始

1. 启动双向同步服务

在您的项目目录中运行:

easyui start

2. 编辑 UI 文件

您可以通过以下方式编辑 UI:

  • 方式一:直接编辑 ui 目录下的 .py 文件
  • 方式二:使用 Qt Designer 编辑 .ui 文件
easyui open

3. 查看服务状态

easyui status

4. 停止服务

easyui stop

工作原理

  1. 目录结构

    • ui/:存放 Python UI 文件(如 ui_test.py
    • .ui_cache/:存放自动生成的 .ui 文件
  2. 双向同步

    • .py 文件变化时,自动转换为 .ui 文件
    • .ui 文件变化时,自动转换为 .py 文件
  3. Qt Designer 集成

    • 自动查找并启动 Qt Designer
    • 当 .ui 文件更新时,自动刷新 Qt Designer 窗口

命令说明

命令 描述
easyui start 启动双向同步服务
easyui stop 停止服务
easyui open 用 Qt Designer 打开当前 UI
easyui status 显示服务运行状态

项目结构

easyui/
├── easyui/
│   ├── __init__.py    # 包初始化文件
│   ├── main.py        # 主功能实现
│   └── utils.py       # 工具函数
├── setup.py           # 包配置文件
├── README.md          # 项目说明
└── requirements.txt   # 依赖项

依赖项

  • PySide6:Qt6 的 Python 绑定
  • watchdog:文件系统监听库
  • pywin32(Windows 平台):Windows API 支持

注意事项

  1. 请确保已安装 PySide6 和 Qt Designer
  2. 第一次运行时会自动创建 ui.ui_cache 目录
  3. 建议在项目根目录运行 easyui 命令

贡献

欢迎提交 Issue 和 Pull Request 来帮助改进这个项目!

许可证

本项目采用 MIT 许可证 - 详见 LICENSE 文件

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyui_zyhgo-1.0.0.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easyui_zyhgo-1.0.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file easyui_zyhgo-1.0.0.tar.gz.

File metadata

  • Download URL: easyui_zyhgo-1.0.0.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for easyui_zyhgo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3e8da3db3a87e8b9c7550cdffa71da4afad0c647348e9b233b4e03fb26ac7a1b
MD5 db79d5d4809bf4378095082771fa0364
BLAKE2b-256 9fe466906e920ba2f4c601cafee5dc5b7800987adff8e7ea65b799e94021b597

See more details on using hashes here.

File details

Details for the file easyui_zyhgo-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: easyui_zyhgo-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for easyui_zyhgo-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2784150cd049712e8f8be1fe2b455980fbbf486a0f48fa3cc4298a9709cb5f8d
MD5 662233414c3180eaa2f1b090dc388b02
BLAKE2b-256 a69b37a9a9327815b932abd58abefd932a91b6e7acfd174860e50092a0f4d950

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page