---
title: "(Python Qt拆分)PyQt 开发：相关资料、工具与环境配置"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/pyqt-dev-resources-tools-env/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/04-应用开发与云端工程/桌面应用开发/(Python Qt拆分)PyQt 开发：相关资料、工具与环境配置.md"
content_hash: 791d986744fb919a84efc627fa84e8655b1c31da7f9c45d5c0d1e237e8f31c1c
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
![assets/image-20250212221147089.png](/media/8c5ada7087b7dee9bfc8.png)


# (Python Qt拆分)PyQt 开发：相关资料、工具与环境配置
## 1. PyQt & PySide 相关文档与教程

在使用 PyQt 或 PySide6 进行 GUI 开发时，官方文档和社区资源是学习的最佳途径。以下是一些重要的文档和教程：

### 官方文档

- **Qt 官方文档**：[Qt 迁移指南](https://doc.qt.io/qt-6/portingguide.html)
- **Qt 维基**：[Qt Wiki](https://wiki.qt.io/Main)
- **Qt for Python (PySide6)**：[Qt for Python 介绍](https://wiki.qt.io/Qt_for_Python)
- **PySide6 快速上手指南**：[PySide6 官方教程](https://doc.qt.io/qtforpython-6/quickstart.html)

### 推荐教程

- **白月黑羽 PyQt 教程**：[PyQt 系统入门](https://www.byhy.net/tut/py/gui/qt_01/)
- **PySide6 GUI 开发全流程（计算器示例）**：[腾讯云教程](https://cloud.tencent.com/developer/article/2334289)
- **简言之博客 PyQt 相关教程**：[PyQt 进阶指南](https://jwt1399.top/posts/41724.html#toc-heading-1)

## 2. PyQt & PySide6 教程与示例代码

如果你更喜欢通过代码示例学习，以下是一些优秀的开源项目和示例代码：

- **Code Editor Example**：[官方代码编辑器示例](https://doc.qt.io/qtforpython-6.2/examples/example_widgets__codeeditor.html)
- **YoloSide (PySide6 GUI 结合 YOLOv8)**：[GitHub 项目](https://github.com/Jai-wei/YOLOv8-PySide6-GUI)
- **PySide6 代码教程**：[PySide6 代码示例](https://github.com/muziing/PySide6-Code-Tutorial)
- **PyQt Fluent Widgets**：[PyQt Fluent 组件库](https://github.com/zhiyiYo/PyQt-Fluent-Widgets)
- **Top 19 Python 桌面应用项目**：[Python 桌面应用合集](https://www.libhunt.com/l/python/topic/desktop-app)

## 3. PyQt / PySide6 界面美化

Qt 提供了强大的界面自定义功能，以下是一些实用的 UI 主题和样式库：

- **Qt-Material**（Material Design 主题）：[官方文档](https://qt-material.readthedocs.io/en/latest/index.html#qt-material)
- **QDarkStyleSheet**（黑暗风格样式表）：[GitHub 项目](https://github.com/ColinDuquesnoy/QDarkStyleSheet)
- **PyQt5 Stylesheets**：[PyQt5 样式表](https://github.com/RedFalsh/PyQt5_stylesheets)
- **Custom Widgets（PyQt 自定义控件）**：[PyQt 自定义控件库](https://github.com/PyQt5/CustomWidgets)

## 4. PyQt / PySide6 开发工具

在 PyQt / PySide6 的开发过程中，有许多工具可以提高效率：

- **QtAwesome**（支持 FontAwesome 图标）：[GitHub 项目](https://github.com/spyder-ide/qtawesome)
- **PyQtDarkTheme**：[PyQt 黑暗主题](https://github.com/5yutan5/PyQtDarkTheme)
- **PyQt-PySide 自定义控件库**：[GitHub 项目](https://github.com/KhamisiKibet/QT-PyQt-PySide-Custom-Widgets)

## 5. 开发环境与流程

在开始 PyQt 开发之前，需要先配置好开发环境。

### 1. 配置 Python 虚拟环境

```sh
python -m venv venv
source venv/bin/activate  # Mac/Linux
venv\Scripts\activate  # Windows
```

### 2. 安装 PySide6

```sh
pip install pyside6==6.3.2
```

### 3. 配置 Qt Designer

Qt Designer 是 Qt 官方提供的可视化 UI 设计工具，需要进行额外配置以支持 PyQt / PySide6。

### 4. 配置 RCC 与 UIC

Qt 资源文件（.qrc）和 UI 文件（.ui）需要转换为 Python 代码，可通过 `pyside6-uic` 和 `pyside6-rcc` 进行转换。

```sh
## 生成 UI 文件的 Python 代码
D:\...\venv\Scripts\pyside6-uic.exe $FileName$ -o $FileNameWithoutAllExtensions$.py

## 生成 RCC 资源文件的 Python 代码
D:\...\venv\Scripts\pyside6-rcc.exe $FileName$ -o $FileNameWithoutAllExtensions$_rc.py
```

### 5. 打包为可执行文件

```sh
pip install pyinstaller auto-py-to-exe
```

`auto-py-to-exe` 是 `pyinstaller` 的 GUI 封装工具，使用方法简单：

1. 运行 `auto-py-to-exe`
2. 选择 Python 入口文件
3. 选择是否单文件、是否包含外部资源
4. 生成 `.exe` 可执行文件

## 6. 参考项目

以下是一些使用 PyQt / PySide6 开发的优秀开源项目，可以参考其架构和实现方式：

- **pyQode（Python 代码编辑器）**：[GitHub 项目](https://github.com/pyQode/pyQode)
- **Frog（任务管理器）**：[GitHub 项目](https://github.com/TenderOwl/Frog/tree/master)
- **Reflex（桌面应用框架）**：[GitHub 项目](https://github.com/reflex-dev/reflex/tree/main)
- **Spyder IDE**（Python 科学计算 IDE）：[GitHub 项目](https://github.com/spyder-ide/spyder)
- **OpenShot（视频编辑软件）**：[GitHub 项目](https://github.com/OpenShot/openshot-qt)
- **Orange（数据可视化工具）**：[GitHub 项目](https://github.com/biolab/orange3)

---

以上是 PyQt / PySide6 开发相关的资料、工具和环境配置指南。后续我可以继续整理 PyQt 开发流程、界面设计、信号槽机制等内容，欢迎持续关注！
