简体   繁体   中英

PyQt -> PySide: Loading ui file in __init__

I am moving from PyQt to PySide. I have been used to load my Qt Designer generated ui files in __init__ like this:

def __init__(self):
    QtGui.QMainWindow.__init__(self)
    uic.loadUi("mygui.ui", self)

    self.mywidget.do_some_other_stuff()

    self.show()

Can this be done with PySide? The closest I've come to is

    self.widget = QtUiTools.QUiLoader().load("mygui.ui"))
    self.setCentralWidget(self.widget)

but my MatplotlibWidget won't show and none of my slots are working.

有实施loadUi为PySide在qtpy抽象层。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM