The main window is constructed in code. For the option pages there are layout files, look for the
There is more involved. Qt designer allows you to add the “search” button to the layout (place it somewhere). But you still need to implement the actual search action in Python.
In general Qt Designer is not much magic. It just is a visual UI designer, where you can build a UI by placing the elements by drag and drop. It can be very convenient especially for a UI with many elements, as it is the case for most option pages.
The UI gets stored in a Qt specific XML format in the .ui files. When you run
setup.py build_ui those XML files get converted to actual Python code as the
picard/ui_*.py files. E.g. take a look at the
picard/ui/ui_options_renaming.py, that code got autogenerated from the corresponding ui file. It defines a
The actual renaming option dialog is manually implemented in
picard/ui/options/renaming.py. In the constructor the autogenerated code from
Ui_RenamingOptionsPage gets called to create the UI elements.
def __init__(self, parent=None):
self.ui = Ui_RenamingOptionsPage()
In general Picard does not use UI files for everything. Sometimes the UI is generated from code, sometimes via UI files. Depending on what is being done one way can be easier than another. Also a hybrid approach is possible, where parts of the UI are configured in the ui file, but certain things are setup in code.