Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shuoGG1239/QCandyUi
方便快速地美化pyQt应用
https://github.com/shuoGG1239/QCandyUi
Last synced: 17 days ago
JSON representation
方便快速地美化pyQt应用
- Host: GitHub
- URL: https://github.com/shuoGG1239/QCandyUi
- Owner: shuoGG1239
- License: mit
- Created: 2018-01-20T04:17:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-06-25T07:22:06.000Z (over 1 year ago)
- Last Synced: 2024-10-02T10:18:38.866Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 555 KB
- Stars: 86
- Watchers: 1
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-qt - QCandyUi
README
# QCandy-UI
方便快速地美化Qt应用, 糖果色扁平化UI# 安装
* pip install QCandyUi# 使用方法
* 仅需在需要美化的窗口类上加上@colorful装饰器即可
* 也可以调用CandyWindow.creatWindow()返回经美化的QWidget (推荐用这种)# 实例
* 原味窗口
```python
# 窗口类为TcpUdpSerialPortTool
# TcpUdpSerialPortTool.py
class TcpUdpSerialPortTool(QWidget):
... ...# main.py
app = QApplication(sys.argv)
mainWindow = TcpUdpSerialportTool.TcpUdpSerialPortTool()
mainWindow.show()
sys.exit(app.exec_())
```
![norm](https://i.loli.net/2018/07/04/5b3c404bde41f.png)
* 加了蓝绿色主题的窗口(使用@colorful)
```python
# 窗口类为TcpUdpSerialPortTool
# TcpUdpSerialPortTool.py
from QCandyUi.CandyWindow import colorful@colorful('blueGreen')
class TcpUdpSerialPortTool(QWidget):
... ...# main.py
app = QApplication(sys.argv)
mainWindow = TcpUdpSerialportTool.TcpUdpSerialPortTool()
mainWindow.show()
sys.exit(app.exec_())
```
![blueGreen](https://i.loli.net/2018/07/04/5b3c412bc2977.png)
* 加了蓝色主题的窗口(使用@colorful)
```python
# 窗口类为TcpUdpSerialPortTool
# TcpUdpSerialPortTool.py
from QCandyUi.CandyWindow import colorful@colorful('blue')
class TcpUdpSerialPortTool(QWidget):
... ...# main.py
app = QApplication(sys.argv)
mainWindow = TcpUdpSerialportTool.TcpUdpSerialPortTool()
mainWindow.show()
sys.exit(app.exec_())
```
![blue](https://i.loli.net/2018/07/10/5b44991103a87.png)
* 加了蓝色主题的窗口(使用CandyWindow.createWindow)
```python
from QCandyUi import CandyWindowmainWindow = TcpUdpSerialportTool.TcpUdpSerialPortTool()
mainWindow = CandyWindow.createWindow(mainWindow, 'blue')
mainWindow.show()
```# Ps:
* 想自己新增颜色主题可以在theme.json里面配, 按照theme.json里的格式配即可
* py模块的安装包在/python-version/dist中