-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathTestRotateButton.py
54 lines (48 loc) · 1.48 KB
/
TestRotateButton.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2019年1月2日
@author: Irony
@site: https://pyqt.site https://github.com/PyQt5
@email: 892768447@qq.com
@file: Test.TestRotateButton
@description:
"""
from PyQt5.QtWidgets import QHBoxLayout, QWidget
from Widgets.Buttons.RotateButton import RotateButton
class Window(QWidget):
def __init__(self, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
layout = QHBoxLayout(self)
layout.addWidget(
RotateButton('6', self, minimumHeight=96, toolTip='旋转按钮'))
layout.addWidget(
RotateButton('',
self,
minimumHeight=96,
image='../Resources/Images/Avatars/avatar.png'))
layout.addWidget(
RotateButton('', self, minimumHeight=96, objectName='imageLabel'))
if __name__ == '__main__':
import cgitb
import sys
sys.excepthook = cgitb.enable(1, None, 5, '')
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
app.setStyleSheet("""
RotateButton {
font-size: 48px;
}
ToolTip > QLabel {
color: white;
border-radius: 5px;
padding: 10px;
background-color: rgba(77, 77, 77, 180);
}
#imageLabel {
qproperty-image: "../Resources/Images/Avatars/avatar.png";
}
""")
w = Window()
w.show()
sys.exit(app.exec_())