Skip to content

Commit

Permalink
set the object name at the toolkit_object level
Browse files Browse the repository at this point in the history
  • Loading branch information
sccolbert committed Sep 30, 2013
1 parent b06e75f commit b3199f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 0 additions & 7 deletions enaml/qt/qt_dock_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def init_widget(self):
"""
super(QtDockItem, self).init_widget()
d = self.declaration
self.set_name(d.name)
self.set_title(d.title)
self.set_title_editable(d.title_editable)
if not d.title_bar_visible:
Expand Down Expand Up @@ -151,12 +150,6 @@ def child_removed(self, child):
#--------------------------------------------------------------------------
# ProxyDockItem API
#--------------------------------------------------------------------------
def set_name(self, name):
""" Set the object name on the underlying widget.
"""
self.widget.setObjectName(name)

def set_title(self, title):
""" Set the title on the underlying widget.
Expand Down
10 changes: 7 additions & 3 deletions enaml/qt/qt_toolkit_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class QtToolkitObject(ProxyToolkitObject):
"""
# PySide requires weakrefs for using bound methods as slots
if QT_API == 'pyside':
__slots__ = '__weakref__'
__slots__ = '__weakref__'

#: A reference to the toolkit widget created by the proxy.
widget = Typed(QObject)

Expand All @@ -45,7 +45,11 @@ def init_widget(self):
state of the widget. The child widgets will not yet be created.
"""
pass
widget = self.widget
if widget is not None:
name = self.declaration.name
if name:
widget.setObjectName(name)

def init_layout(self):
""" Initialize the layout of the toolkit widget.
Expand Down

0 comments on commit b3199f3

Please sign in to comment.