This commit is contained in:
Luke Campagnola 2014-04-11 23:43:45 -04:00
parent df8562ce55
commit f54dac6c70

View File

@ -28,8 +28,6 @@ def _defersort(fn):
self.setSortingEnabled(self._sorting) self.setSortingEnabled(self._sorting)
self._sorting = None self._sorting = None
defersort.func_name = fn.func_name + '_defersort'
return defersort return defersort
@ -63,15 +61,13 @@ class TableWidget(QtGui.QTableWidget):
self.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) self.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
self.clear() self.clear()
if 'sortable' not in kwds: kwds.setdefault('sortable', True)
kwds['sortable'] = True kwds.setdefault('editable', False)
for kwd, val in kwds.items(): self.setEditable(kwds.pop('editable'))
if kwd == 'editable': self.setSortingEnabled(kwds.pop('sortable'))
self.setEditable(val)
elif kwd == 'sortable': if len(kwds) > 0:
self.setSortingEnabled(val) raise TypeError("Invalid keyword arguments '%s'" % kwds.keys())
else:
raise TypeError("Invalid keyword argument '%s'" % kwd)
self._sorting = None self._sorting = None