load uic file
-
I have found the following topic, which i would like to adopt in part:
https://forum.qt.io/topic/124028/display-custom-list-of-files-in-qtreeview-using-qfilesystemmodel-or-qabstractitemmodel/6Can someone please tell me how to convert the code so that the data is output to a specified UI file?
-
I have found the following topic, which i would like to adopt in part:
https://forum.qt.io/topic/124028/display-custom-list-of-files-in-qtreeview-using-qfilesystemmodel-or-qabstractitemmodel/6Can someone please tell me how to convert the code so that the data is output to a specified UI file?
-
@MaMo
There is no output or data in that topic. It's just about displaying files in a treeview. What is "a specified UI file"? What does your title "load uic file" mean? -
I have created a complex window with qt designer with a treeview. This is saved as a UI file. Now i would like to know how i can integrate this file into the code from the other topic.
@MaMo
From your.ui
file you either generate a.py
file from it or you dynamically load it at runtime (https://doc.qt.io/qtforpython-6/tutorials/basictutorial/uifiles.html). Either way you end up with aQTreeView
or a class derived from it. You then calltreeView.setModel(theFileSystemModel)
at runtime to connect the view to the model (https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QTreeView.html#detailed-description). -
I have always integrated the ui as follows:
from PyQt5 import QtWidgets, QtCore, uic class ListMovies(QtWidgets.QMainWindow): def __init__(self): super().__init__() uic.loadUi("GUI\GUI_Movies.ui", self) self.readAllMoviesButton.clicked.connect(self.on_read_all_entry) self.readMainMoviesButton.clicked.connect(self.on_read_main_entry) self.updateListButton.clicked.connect(self.on_update_list) self.addListButton.clicked.connect(self.on_add_list) self.newEntryButton.clicked.connect(self.on_new_entry) self.saveCsvButton.clicked.connect(self.on_save_csv) self.saveXlsButton.clicked.connect(self.on_save_xls) # self.actionSave.triggered.connect(self.on_save) self.moviesTable.itemDoubleClicked.connect(self.OpenLink) self.progressBar.hide() ui_width = self.width() ui_height = self.height() # self.setFixedWidth(ui_width) # self.setFixedHeight(ui_height) xy = fc.center_window(self, ui_width, ui_height) self.move(int(xy[0]), int(xy[1])) self.show()
Can someone please tell me how to insert it exactly into the code linked above?
Maybe someone can even give me the right lines of code?