@@ -97,17 +97,47 @@ class action_handler_t_objprotector(action_handler_t_object):
97
97
98
98
@staticmethod
99
99
def qtsignalslot ():
100
- """While pre-6.8 qt4 library pyside exposted `Qtcore.Signal` and
100
+ """While pre-6.8 qt4 library pyside exposed `Qtcore.Signal` and
101
101
`QtCore.Slot`, new pyqt library exposes those same methods as
102
102
`QtCore.pyqtSignal` and `QtCore.pyqtSlot`. This fix makes sure
103
- `Qtcore.Signal` and `QtCore.Slot` are always available"""
103
+ `Qtcore.Signal` and `QtCore.Slot` are always available.
104
+
105
+ While pyqt4 and pyside are equivalent, they are different implementations.
106
+ Therefore some slight variations and bugs may manifest in one but not the
107
+ other. An example of this is pyside's buggy handling of callback closures.
108
+
109
+ """
104
110
if IDA_SDK_VERSION >= 690 :
105
111
QtCore .Signal = QtCore .pyqtSignal
106
112
QtCore .Slot = QtCore .pyqtSlot
107
113
elif IDA_SDK_VERSION < 690 :
114
+
115
+
116
+ class pysideSignal_wrapper (QtCore .QObject ):
117
+
118
+ pysideSignal_cls = QtCore .Signal
119
+ pysideSignalInstance = QtCore .Signal (dict )
120
+
121
+ def __init__ (self , * args , ** kwargs ):
122
+ self .pysideSignal_obj = self .pysideSignal_cls (* args , ** kwargs )
123
+
124
+ def __getattr__ (self , attr ):
125
+ print (self , self .pysideSignalInstance , attr )
126
+ return getattr (self .pysideSignal_obj , attr )
127
+
128
+ def connect (self , callback , * w_args , ** w_kwargs ):
129
+ print (self , callback )
130
+ wrapped_callback = lambda * args , ** kwargs : callback (* args , ** kwargs )
131
+ return self .pysideSignal_obj .connect (wrapped_callback , * w_args , ** w_kwargs )
132
+
133
+ QtCore .Signal = pysideSignal_wrapper
134
+ print (pysideSignal_wrapper .pysideSignalInstance , type (pysideSignal_wrapper .pysideSignalInstance ))
135
+ i = pysideSignal_wrapper ()
136
+ print (i , type (i ))
137
+ print (i .connect )
138
+ i .connect = None
108
139
pass
109
140
110
-
111
141
Fix .packagespath ()
112
142
Fix .actionhandlerobject ()
113
143
Fix .qtsignalslot ()
0 commit comments