Pass hex values as int in Pyqt signals and slots
-
wrote on 2 Dec 2020, 17:55 last edited by
How do I pass a hexadecimal value in a qt signal and use it in a slot in PyQt5 signals and slots method
-
How do I pass a hexadecimal value in a qt signal and use it in a slot in PyQt5 signals and slots method
wrote on 2 Dec 2020, 17:57 last edited by JonB 12 Feb 2020, 17:59@Praanesh
This has been asked before. There is no such as "a hexadecimal value", as a type, not in C++ and not in Python. Either you have a number (integer) or perhaps you have a string which is a representation in hex of a number. Which is it? What type is it? That's what you pass in the signal/slot. -
wrote on 10 Dec 2020, 06:26 last edited by
function.something.emit(0x1234)
or
function.something.emit("hex string")add "type checking" logic in the slot function since in python types are infererd from the rvalue of the expression.