-
Notifications
You must be signed in to change notification settings - Fork 1
/
ImprovedRadioButton.py
49 lines (39 loc) · 1.09 KB
/
ImprovedRadioButton.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
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QRadioButton, QFont
"""
Improved QRadioButton:
- Int value
- Str Value
"""
class CImprovedRadioButton(QRadioButton):
'''
classdocs
'''
def __init__(self, parent=None):
'''
Constructor
'''
QRadioButton.__init__(self, parent)
font = QFont( "Arial", 12)
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)