Issue
I want to load the window.ui
file from resources_rc.py
I tried:
import resources_rc
class Ui(QtWidgets.QMainWindow):
def __init__(self):
super(Ui, self).__init__()
uic.loadUi(':/newPrefix/window.ui', self)
But
OSError: [Errno 22] Invalid argument: ':/newPrefix/window.ui'
PyQt: How do I load a ui file from a resource? didn't help.
Solution
Solved. Thanks to musicamante
stream = QtCore.QFile(":/newPrefix/window.ui")
stream.open(QtCore.QFile.ReadOnly)
uic.loadUi(stream, self)
stream.close()
Answered By - Adib
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.