Move setSortingEnabled to the widget init rather than after setting the data, otherwise weird sorting happens
This commit is contained in:
parent
cba720730d
commit
e4314f883d
@ -27,6 +27,7 @@ class TableWidget(QtGui.QTableWidget):
|
||||
self.setVerticalScrollMode(self.ScrollPerPixel)
|
||||
self.setSelectionMode(QtGui.QAbstractItemView.ContiguousSelection)
|
||||
self.setSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
|
||||
self.setSortingEnabled(True)
|
||||
self.clear()
|
||||
self.contextMenu = QtGui.QMenu()
|
||||
self.contextMenu.addAction('Copy Selection').triggered.connect(self.copySel)
|
||||
@ -45,7 +46,6 @@ class TableWidget(QtGui.QTableWidget):
|
||||
def setData(self, data):
|
||||
self.clear()
|
||||
self.appendData(data)
|
||||
self.setSortingEnabled(True)
|
||||
self.resizeColumnsToContents()
|
||||
|
||||
def appendData(self, data):
|
||||
|
Loading…
Reference in New Issue
Block a user