Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.columnDestination.setCurrentItem(self.columnDestination.topLevelItem(0))
# Add to items to selection section
self.addTreeItem('test1')
self.addTreeItem('test2')
def addTreeItem(self, label):
# Add to tree
destinationSection = self.columnDestination.selectedItems()[0]
treeItem = QtWidgets.QTreeWidgetItem(destinationSection, [label])
destinationSection.setExpanded(True)
treeItem.setFlags(treeItem.flags() & ~QtCore.Qt.ItemIsDropEnabled)
import sys
app = QtWidgets.QApplication(sys.argv)
win = columnPicker()
app.exec_()
def initUI(self):
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
self.columnPicker = columnPicker()