<div dir="ltr">Hi,<div><br></div><div>I have some code that defines an enum nested in a class, defines a pyqtProperty using that enum, then uses the value of that to control a stylesheet.</div><div><br></div><div>In PyQt5 5.15, I use the Q_ENUM macro to annotate the enum class after defining it, and everything works fine. Changing the value of the pyqtProperty after creating the widget then repolishing it causes the colour to change. This works whether the property's class is an enum or just a normal object.</div><div><br></div><div>In PyQt6 6.4 (and 6.3), I use pyqtEnum as a decorator on the enum class (also tried using it afterwards in the same place I'd use Q_ENUM), and while the widget initially appears to have the correct colour, it won't change if I update the property.</div><div><br></div><div>(In both cases, I actually have to use enum.IntEnum, as I get a hardcrash 0xC0000409 during the polishing phase when using a normal Enum).</div><div><br></div><div>Perhaps I'm doing something wrong on the stylesheet, but I've tried every possible syntax I can think of: using the enum member name, member value, putting it in quotes or not etc.</div><div><br></div><div>I've attached two examples in PyQt5 and PyQt6, the only real difference between them is in:</div><div><br></div><div>class ProgressBar(QProgressBar):<br>    class Status(enum.IntEnum):<br>        success = 0<br>        error = 1<br>    Q_ENUM(Status)</div><div><br></div><div>v.s.</div><div><br></div><div>class ProgressBar(QProgressBar):<br>    @pyqtEnum<br>    class Status(enum.IntEnum):<br>        success = 0<br>        error = 1<br></div><div><div><br></div><div>Any advice is much appreciated, can't work out if this is a bug or just me!</div><div><br></div></div><div>Cheers,</div><div>Arthur</div><div><br></div></div>