In pyqt, one can access wid as sip.voidptr
, using widget.winId()
, and then turn it to capsule object using wid.ascapsule()
In pyside6, when using widget.winId()
, I can only get an int number.
How can I get winId() as ptr like pyqt when using pyside6?
I need ptr as capsule because the api I use give the following error:
return WNT_Window(ctypes.c_void_p(wid)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TypeError: __init__(): incompatible constructor arguments. The following argument types are supported: 1. OCP.WNT.WNT_Window(theTitle: str, theClass: OCP.WNT.WNT_WClass, theStyle: int, thePxLeft: int, thePxTop: int, thePxWidth: int, thePxHeight: int, theBackColor: OCP.Quantity.Quantity_NameOfColor = <Quantity_NameOfColor.Quantity_NOC_MATRAGRAY: 2>, theParent: capsule = None, theMenu: capsule = None, theClientStruct: capsule = None) 2. OCP.WNT.WNT_Window(theHandle: capsule, theBackColor: OCP.Quantity.Quantity_NameOfColor = <Quantity_NameOfColor.Quantity_NOC_MATRAGRAY: 2>)