From 78d8a3aec33b65ee48fc8de115c80c22b92ff1dd Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Tue, 2 Jun 2015 14:44:04 +0200 Subject: [PATCH] Adds: drag and drop -- corrections --- src/mainWindow.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mainWindow.py b/src/mainWindow.py index 935f4518..0c64bd90 100644 --- a/src/mainWindow.py +++ b/src/mainWindow.py @@ -160,10 +160,13 @@ class MainWindow(QMainWindow, Ui_MainWindow): #################################################################################################### def outlineAddItem(self, type="folder"): - currentIndex = self.treeRedacOutline.currentIndex() - print(currentIndex) + if len(self.treeRedacOutline.selectedIndexes()) == 0: + parent = QModelIndex() + else: + parent = self.treeRedacOutline.currentIndex() + item = outlineItem("Nouveau", type) - self.mdlOutline.appendItem(item, currentIndex) + self.mdlOutline.appendItem(item, parent) def outlineRemoveItems(self): for idx in self.treeRedacOutline.selectedIndexes():