Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how i'm supposed to internally structure my project with Qt?
adrian88888888 last edited by
idk how i'm supposed to internally structure my program using the Qt framework,in my actual case i have 3 files:
here i have the basic stuff:
imports.... class MainWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.ui = Ui_MainWindow() self.ui.setupUi(self). self.show() if __name__ == "__main__": app = QApplication(sys.argv) window = MainWindow() sys.exit(app.exec_())
it has all the def´s that gives the gui functionality(i guess?), for example:
my problem it's when i do something, where the module should be?, in an app_Def.py for example?
or maybe all this is nonsense and that's not the standard way to organize stuff?
that's the .py generated by QDesigner(it has the Ui_MainWindow class)
JonB last edited by JonB
I don't understand what is in/the purpose of your
How are you gaining access to
a_button_in_the_ui? I would just expect this to be in
MainWindow, where you can go
Then if you want that clicked slot code to be elsewhere in another module/file, that's fine. Whether it should need a parameter of
selfis not so clear, why do you need to pass the
MainWindowinstance off to somewhere? In general, you don't want that other something module to be accessing things back in the main window....
adrian88888888 last edited by adrian88888888
i placed the:
not inside the MainWindow instance because there are lots of those connections, and there's more stuff in reality, and it's becoming a total mess, that why im in problems with how to organize internally, the instance its getting full of different stuff
yes, the self part i got no idea yet
yes i know it doesn't make sense, what should i do? what would you do in my case?
Thanks btw for helping me