Files
Zordon/src/ui/widgets/treeview.py
Brett 65c256b641 New UI Redesign in pyqt6 (#56)
* Initial commit for new UI

* Initial commit for new UI

* WIP

* Status bar updates and has an icon for online / offline

* Add log_viewer.py

* Use JSON for delete_engine_download API

* Fix class issue with Downloaders

* Move Config class to new ui

* Add engine_browser.py

* Add a close event handler to the main window

* Fix issue with engine manager not deleting engines properly

* Rearrange all the files

* Add icons and resources

* Cache system info in RenderServerProxy

* Toolbar polish

* Fix resource path in status bar

* Add config_dir to misc_helper.py

* Add try block to zeroconf setup

* Add add_job.py

* Add raw args to add_job.py
2023-11-04 09:52:15 -05:00

30 lines
894 B
Python

''' app/ui/widgets/treeview.py '''
from PyQt6.QtWidgets import QTreeView
from PyQt6.QtGui import QFileSystemModel
from PyQt6.QtCore import QDir
class TreeView(QTreeView):
"""
Initialize the TreeView widget.
Args:
parent (QWidget, optional): Parent widget of the TreeView. Defaults to None.
"""
def __init__(self, parent=None) -> None:
super().__init__(parent)
self.file_system_model: QFileSystemModel = QFileSystemModel()
self.file_system_model.setRootPath(QDir.currentPath())
self.setModel(self.file_system_model)
self.setRootIndex(self.file_system_model.index(QDir.currentPath()))
self.setColumnWidth(0, 100)
self.setFixedWidth(150)
self.setSortingEnabled(True)
def clear_view(self) -> None:
"""
Clearing the TreeView
"""
self.destroy(destroySubWindows=True)