Skip to content

Commit

Permalink
Merge branch 'master' into release-5.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kitchoi committed Apr 18, 2016
2 parents 4d5c7d9 + e373e5c commit 056273a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
3 changes: 1 addition & 2 deletions traitsui/qt4/instance_editor.py
Expand Up @@ -508,8 +508,7 @@ def edit_instance(self):
ui = self.value.edit_traits( view, kind=factory.kind, id=factory.id )

# Make sure the editor is properly disposed
QtCore.QObject.connect( self._button, QtCore.SIGNAL( 'destroyed()' ),
lambda: ui.dispose() )
self._button.destroyed.connect( ui.dispose )

# Check to see if the view was 'modal', in which case it will already
# have been closed (i.e. is None) by the time we get control back:
Expand Down
7 changes: 1 addition & 6 deletions traitsui/qt4/table_editor.py
Expand Up @@ -281,10 +281,6 @@ def init(self, parent):
def dispose(self):
""" Disposes of the contents of an editor."""

# Disconnect the table view from its model to ensure that they do not
# continue to interact (the control won't be deleted until later).
self.table_view.setModel(None)

# Make sure that the auxillary UIs are properly disposed
if self.toolbar_ui is not None:
self.toolbar_ui.dispose()
Expand All @@ -303,7 +299,6 @@ def dispose(self):
self.on_trait_change(self._update_columns, 'columns', remove=True)
self.on_trait_change(self._update_columns, 'columns_items', remove=True)


super(TableEditor, self).dispose()

#---------------------------------------------------------------------------
Expand Down Expand Up @@ -387,7 +382,7 @@ def items(self):
if not isinstance(items, SequenceTypes):
items = [ items ]

if self.factory.reverse:
if self.factory and self.factory.reverse:
items = ReversedList(items)

return items
Expand Down
5 changes: 2 additions & 3 deletions traitsui/qt4/ui_base.py
Expand Up @@ -232,7 +232,7 @@ def add_button ( self, action, bbox, role, method=None, enabled=True,
method = editor.perform

if method is not None:
button.connect(button, QtCore.SIGNAL('clicked()'), method)
button.clicked.connect(method)

if action.tooltip != '':
button.setToolTip(action.tooltip)
Expand Down Expand Up @@ -444,8 +444,7 @@ def create_dialog(self, parent, style):
control.setModal(style == BaseDialog.MODAL)
control.setWindowTitle(view.title or DefaultTitle)

QtCore.QObject.connect(control, QtCore.SIGNAL('finished(int)'),
self._on_finished)
control.finished.connect(self._on_finished)

def add_contents(self, panel, buttons):
"""Add a panel (either a widget, layout or None) and optional buttons
Expand Down
7 changes: 1 addition & 6 deletions traitsui/qt4/ui_panel.py
Expand Up @@ -255,9 +255,6 @@ def panel(ui):
panel = _GroupPanel(content[0], ui).control
elif nr_groups > 1:
panel = QtGui.QTabWidget()
# Identify ourselves as being a Tabbed group so we can later
# distinguish this from other QTabWidgets.
panel.setProperty("traits_tabbed_group", True)
_fill_panel(panel, content, ui)
panel.ui = ui

Expand Down Expand Up @@ -551,7 +548,6 @@ def __init__(self, group, ui, suppress_label=False):
# Create the TabWidget or ToolBox.
if group.layout == 'tabbed':
sub = QtGui.QTabWidget()
sub.setProperty("traits_tabbed_group", True)
else:
sub = QtGui.QToolBox()

Expand Down Expand Up @@ -1253,8 +1249,7 @@ def __init__ ( self, parent, html, scale_dx, scale_dy ):
# Create the OK button
bbox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok,
QtCore.Qt.Horizontal)
QtCore.QObject.connect(bbox, QtCore.SIGNAL('accepted()'),
self, QtCore.SLOT('accept()'))
bbox.accepted.connect(self.accept)
layout.addWidget(bbox)

# Position and show the dialog
Expand Down

0 comments on commit 056273a

Please sign in to comment.