Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
It would be more pythonic, if QFile would have _enter_ + _exit_ to be also full-featured py file object (=mimic io.FileIO interface a bit).
Then you can write the dynamic .ui file loading:
loader=QtUiTools.QUiLoader() try: with QtCore.QFile("path-to-ui.ui") as f: window = loader.load(f) return window except Exception as e: logger.error("... %s : %s", type(e), e)
(Improvemement to https://bit.ly/3mapkTk)
Attachments
Gerrit Reviews
For Gerrit Dashboard: PYSIDE-1380 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
345941,3 | WIP: Add context manager handling to QIODevice | dev | pyside/pyside-setup | Status: NEW | -2 | 0 |