Skip to content Skip to sidebar Skip to footer

How To Launch An Interactive View Of A Table After File Dialog In Pyqt5?

Using PyQt5, I made two widgets. The first widget is a user-prompt to select a file with an alert that confirms the selected filepath. The BackEnd reads the selected data file and

Solution 1:

In MainWindow.interact_with_table, the TableWindow widget is assigned to a local variable. When interact_with_table returns, this variable goes out of scope and the reference count of TableWindow goes to zero. This will cause the TableWindow object to be deleted during the next garbage collection cycle. One solution is to make a persistant reference to the table window for example by assigning it to an instance variable of MainWindow, i.e.

def interact_with_table(self):
    self.table_window = TableWindow(self.backend.data.tolist())
    self.table_window.show()

Post a Comment for "How To Launch An Interactive View Of A Table After File Dialog In Pyqt5?"