-
Notifications
You must be signed in to change notification settings - Fork 1
/
LightBlueRadio.py
59 lines (48 loc) · 1.4 KB
/
LightBlueRadio.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
55
56
57
58
59
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QRadioButton, QFont
from improved_components_resources import components_resources
class CLightBlueRadio(QRadioButton):
'''
classdocs
'''
styleSheet = """
QRadioButton::indicator::checked{
height:40px;
width:40px;
border-image: url(:/images/radiobuttons/radio_on_1.png);
}
QRadioButton::indicator::unchecked{
height:40px;
width:40px;
border-image: url(:/images/radiobuttons/radio_off_1.png);
}
"""
def __init__(self, parent=None):
'''
Constructor
'''
QRadioButton.__init__(self, parent)
self.setStyleSheet(self.styleSheet)
font = QFont( "Arial", 18)
self.setFont(font)
#VARIABILI INTERNE
self.__intValue = 0
self.__strValue = ""
def setStrValue(self, txt):
""" Sets string value of the radioButton.
@param txt: text
@type txt: string
"""
self.__strValue = txt
def getStrValue(self):
return str(self.__strValue)
stringValue = QtCore.pyqtProperty("QString", getStrValue, setStrValue)
def setIntValue(self, value):
""" Sets integer value of the radioButton.
@param value: integer value
@type value: int
"""
self.__intValue = value
def getIntValue(self):
return self.__intValue
intValue = QtCore.pyqtProperty("int", getIntValue, setIntValue)