@@ -218,6 +218,7 @@ def is_edit_valid(edit):
218218
219219
220220class FormWidget (QtGui .QWidget ):
221+ update_buttons = QtCore .Signal ()
221222 def __init__ (self , data , comment = "" , parent = None ):
222223 QtGui .QWidget .__init__ (self , parent )
223224 from copy import deepcopy
@@ -292,8 +293,7 @@ def setup(self):
292293 field .setValidator (QtGui .QDoubleValidator (field ))
293294 dialog = self .get_dialog ()
294295 dialog .register_float_field (field )
295- self .connect (field , QtCore .SIGNAL ('textChanged(QString)' ),
296- lambda text : dialog .update_buttons ())
296+ field .textChanged .connect (lambda text : dialog .update_buttons ())
297297 elif isinstance (value , int ):
298298 field = QtGui .QSpinBox (self )
299299 field .setRange (- 1e9 , 1e9 )
@@ -343,6 +343,8 @@ def get(self):
343343
344344
345345class FormComboWidget (QtGui .QWidget ):
346+ update_buttons = QtCore .Signal ()
347+
346348 def __init__ (self , datalist , comment = "" , parent = None ):
347349 QtGui .QWidget .__init__ (self , parent )
348350 layout = QtGui .QVBoxLayout ()
@@ -370,6 +372,8 @@ def get(self):
370372
371373
372374class FormTabWidget (QtGui .QWidget ):
375+ update_buttons = QtCore .Signal ()
376+
373377 def __init__ (self , datalist , comment = "" , parent = None ):
374378 QtGui .QWidget .__init__ (self , parent )
375379 layout = QtGui .QVBoxLayout ()
@@ -421,8 +425,7 @@ def __init__(self, data, title="", comment="",
421425 # Button box
422426 self .bbox = bbox = QtGui .QDialogButtonBox (QtGui .QDialogButtonBox .Ok
423427 | QtGui .QDialogButtonBox .Cancel )
424- self .connect (self .formwidget , QtCore .SIGNAL ('update_buttons()' ),
425- self .update_buttons )
428+ self .formwidget .update_buttons .connect (self .update_buttons )
426429 if self .apply_callback is not None :
427430 apply_btn = bbox .addButton (QtGui .QDialogButtonBox .Apply )
428431 apply_btn .clicked .connect (self .apply )
0 commit comments