Adds: drag and drop -- corrections

This commit is contained in:
Olivier Keshavjee 2015-06-02 14:44:04 +02:00
parent 8e3cde0e69
commit 78d8a3aec3

View file

@ -160,10 +160,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
#################################################################################################### ####################################################################################################
def outlineAddItem(self, type="folder"): def outlineAddItem(self, type="folder"):
currentIndex = self.treeRedacOutline.currentIndex() if len(self.treeRedacOutline.selectedIndexes()) == 0:
print(currentIndex) parent = QModelIndex()
else:
parent = self.treeRedacOutline.currentIndex()
item = outlineItem("Nouveau", type) item = outlineItem("Nouveau", type)
self.mdlOutline.appendItem(item, currentIndex) self.mdlOutline.appendItem(item, parent)
def outlineRemoveItems(self): def outlineRemoveItems(self):
for idx in self.treeRedacOutline.selectedIndexes(): for idx in self.treeRedacOutline.selectedIndexes():