-
Notifications
You must be signed in to change notification settings - Fork 76
/
TestCSlider.py
44 lines (35 loc) · 1.21 KB
/
TestCSlider.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2019年7月24日
@author: Irony
@site: https://pyqt5.com https://github.com/892768447
@email: 892768447@qq.com
@file: TestCSlider
@description:
"""
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
from CustomWidgets.CSlider import CSlider
__Author__ = 'Irony'
__Copyright__ = 'Copyright (c) 2019 Irony'
__Version__ = 1.0
class Window(QWidget):
def __init__(self, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
self.setAttribute(Qt.WA_StyledBackground, True)
self.setStyleSheet('Window{background:gray;}')
layout = QVBoxLayout(self)
self.labelValue = QLabel(self)
layout.addWidget(CSlider(
Qt.Vertical, self, valueChanged=lambda v: self.labelValue.setText(str(v))))
layout.addWidget(CSlider(
Qt.Horizontal, self, valueChanged=lambda v: self.labelValue.setText(str(v))))
layout.addWidget(self.labelValue)
if __name__ == '__main__':
import sys
from PyQt5.QtWidgets import QApplication
app = QApplication(sys.argv)
w = Window()
w.show()
sys.exit(app.exec_())