qt - Python GUI class structure calls -


let's example have 2 classes, a , b.

class a 1 called class main , b gui class(lets called class main_gui).

gui class contains method initiates , sets views, buttons , stuff called setupui. class generated qtcreator.

what else must class have make sufficient run b or called other classes? know calling __init__ not mandatory idea. must function contain? __main__ mandatory make runnable?

what must __main__ contain? must constructor contain? stuck on calling classes , can't find simple enough explanation or simple enough sample code can implement in case. please explain braindead human.

i java developer new in python , specifics. if possible provide code samples (even pseudocode do) helpful. in advance!

not sure if looking :

a simple view :

class home(qtwidgets.qframe, ui_home): """home view."""  def __init__(self, parent=none):     """initializer."""     super(home, self).__init__()     self._parent = parent     self.setupui(self) 

ui_home qtdesigner generated class

in main create qapplication , exec :

app = qtwidgets.qapplication(sys.argv) 

then can call home_controller or create home display view:

home = home() sys.exit(app.exec_()) 

obviously simple exemple in real app, have class handle controller/ view creation but, simple that


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -