Bugfix for KeyBindingsEditor in TraitsBackendQt trunk

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bugfix for KeyBindingsEditor in TraitsBackendQt trunk

Jonathan Blakes
Attempting to edit_traits() on a KeyBindings instance in ETS trunk, as
per the example here
(http://code.enthought.com/projects/traits/docs/html/TUIUG/factories_advanced_extra.html#keybindingeditor)
results in:

Traceback (most recent call last):
...
   File
"/home/jvb/src/ETS_3.4.0/TraitsBackendQt/enthought/traits/ui/qt4/key_binding_editor.py",
line 67, in init
     self.control = KeyBindingCtrl(self, parent)
   File
"/home/jvb/src/ETS_3.4.0/TraitsBackendQt/enthought/traits/ui/qt4/key_binding_editor.py",
line 147, in __init__
     QtGui.QLabel.__init__(self, parent)
TypeError: arguments did not match any overloaded call:
   QLabel(QWidget parent=None, Qt.WindowFlags flags=0): argument 1 has
unexpected type 'QBoxLayout'
   QLabel(QString, QWidget parent=None, Qt.WindowFlags flags=0):
argument 1 has unexpected type 'QBoxLayout'

I got around this by changing:

         QtGui.QLabel.__init__(self, parent)

to:
         QtGui.QLabel.__init__(self, parent.parent())

in File
"/home/jvb/src/ETS_3.4.0/TraitsBackendQt/enthought/traits/ui/qt4/key_binding_editor.py",
line 147, in __init__

It failed because QBoxLayout inherits from QObject and never QWidget
whereas the parent of QBoxLayout (in this case) is an instance of QWidget.

I am raising this here because I haven't been able to successfully
register in ETS trac. Any help with this would be much appreciated.

Cheers,

Jon
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev