Skip to content

Commit d0ac241

Browse files
committed
qtvcp -pushbutton: fix setting of group pin type
Enums are evil in Qt. if the class enums variable use the same definition, it silently breaks the setting of the pin type. so PinType class can be: NONE = 0 BIT = hal.Type.BOOL # Deprecated <<<<< S32 = hal.HAL_S32 FLOAT = hal.Type.REAL # Deprecated <<<< BOOL = hal.Type.BOOL SINT = hal.Type.SINT REAL = hal.Type.REAL but class variables must be: NONE = 0 BIT = hal.HAL_BIT # Deprecated <<<< S32 = hal.HAL_S32 FLOAT = hal.HAL_FLOAT # Deprecated <<<<< BOOL = hal.Type.BOOL SINT = hal.Type.SINT REAL = hal.Type.REAL Don't know why.
1 parent 8c7ef3a commit d0ac241

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/python/qtvcp/widgets/simple_widgets.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545

4646
class HALPinType(enum.IntEnum):
4747
NONE = 0
48-
BIT = hal.Type.BOOL # Deprecated
49-
S32 = hal.HAL_S32
50-
FLOAT= hal.Type.REAL # Deprecated
48+
BIT = hal.Type.BOOL # Deprecated
49+
S32 = hal.HAL_S32
50+
FLOAT = hal.Type.REAL # Deprecated
5151
BOOL = hal.Type.BOOL
5252
SINT = hal.Type.SINT
5353
REAL = hal.Type.REAL
@@ -362,9 +362,9 @@ class PushButton(QtWidgets.QPushButton, IndicatedMixIn):
362362

363363
# older version of pyqt5 need this as well as QEnum
364364
NONE = 0
365-
BIT = hal.Type.BOOL # Deprecated
366-
S32 = hal.HAL_S32
367-
FLOAT= hal.Type.REAL # Deprecated
365+
BIT = hal.HAL_BIT # Deprecated
366+
S32 = hal.HAL_S32
367+
FLOAT = hal.HAL_FLOAT # Deprecated
368368
BOOL = hal.Type.BOOL
369369
SINT = hal.Type.SINT
370370
REAL = hal.Type.REAL

0 commit comments

Comments
 (0)