-
-
Save altendky/6743848cdc18e10043fb0086b3ce57f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import attr | |
import PyQt5.uic | |
Ui, UiBase = PyQt5.uic.loadUiType( | |
pathlib.Path(__file__).with_suffix('.ui'), | |
) | |
@attr.s | |
class FilesView(UiBase): | |
ui = attr.ib(factory=Ui) | |
@classmethod | |
def build(cls, parent): | |
instance = cls() | |
instance.setParent(parent) | |
return instance | |
def __attrs_post_init__(self): | |
super().__init__() | |
if self.ui is not None: | |
self.ui.setupUi(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment