1 Star 0 Fork 49

Akizuki/openQPA

forked from l7dpi/openQPA 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
RoundWindow.py 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
@contact QQ327909056
'''
from PyQt4.QtGui import QBitmap,QPainter,QColor,QWidget
from PyQt4.QtCore import QPointF,Qt
class RoundWindow(QWidget):
def __init__(self):
super(RoundWindow, self).__init__()
self.setWindowFlags(Qt.FramelessWindowHint)
def round(self):
bmp = QBitmap(self.size())
p = QPainter()
p.begin(bmp)
p.fillRect(bmp.rect(), Qt.white)
p.setBrush(QColor(0,0,0))
p.drawRoundedRect(bmp.rect(), 5, 5)
p.setPen(QColor(255,255,255,255))
p.drawPoints(QPointF(self.width()-2,self.height()-1), QPointF(self.width()-1,self.height()-2))
p.setPen(QColor(0,0,0))
p.drawPoints(QPointF(0,2),QPointF(3,0),QPointF(2,0),QPointF(1,1))
p.end()
self.setMask(bmp)
def paintEvent(self,event):
p = QPainter(self)
p.setBrush(QColor(0xf9f9f9))
p.setPen(QColor(0x49585f))
p.drawRoundedRect(0, 0, self.width()-1, self.height()-1, 3, 3)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ak1zuki/openQPA.git
git@gitee.com:ak1zuki/openQPA.git
ak1zuki
openQPA
openQPA
master

搜索帮助