Answer the question
In order to leave comments, you need to log in
How to correctly connect a .ui file to Python?
Guys with experience! Tell me how to correctly connect files from qtdesiner (.ui).
1) Convert it to .py (It's not very convenient to edit the design, but it's not very convenient to code, since widget names are not automatically substituted)
2) Just include .ui (Pros and cons exactly the opposite)
Does connecting .ui really slow down the program?
I'm connecting like this now
app = QApplication(sys.argv)
main_class, base_class = loadUiType('main.ui')
class MainWindow(QMainWindow, main_class):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
self.setupUi(self)
Answer the question
In order to leave comments, you need to log in
Can be connected directly, can be converted to .py. The main thing is not to edit this file manually. And if you need to redefine something in the design that cannot be edited in qtdesigner, then it is better to do this in the main program file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question