From 733a9b61acc2c134b8a2b736e872ef6752258130 Mon Sep 17 00:00:00 2001 From: cuissedemouche Date: Tue, 13 Dec 2022 23:12:32 +0000 Subject: [PATCH] Item selection --- main_window.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main_window.py b/main_window.py index 893c41b..2d1b138 100644 --- a/main_window.py +++ b/main_window.py @@ -19,7 +19,7 @@ class MainWindow(QWidget, Ui_MainWindow): def setupConnections(self): - pass + self.media_tracks_list_widget.itemClicked.connect(self.popuplate_content) def dragEnterEvent(self, event): @@ -39,10 +39,16 @@ class MainWindow(QWidget, Ui_MainWindow): self.setWindowTitle(f"{self.filePath} - {self.windowTitle}") self.populate_tabs() + item = self.media_tracks_list_widget.item(0).setSelected(True) + self.popuplate_content() - def populate_tabs(self, path = ''): + def populate_tabs(self): self.media_tracks_list_widget.clear() self.media_tracks_list_widget.addItems(self.fileCmds.tabsList) - text = self.fileCmds.tabsContent["Basic"] + + + def popuplate_content(self): + itemSelected = self.media_tracks_list_widget.selectedItems()[0].text() + text = self.fileCmds.tabsContent[itemSelected] self.media_detail_plain_text_edit.setPlainText(text) \ No newline at end of file