heat_transfer_gui.py
def add_material_choice(self, parent_layout) -> None:
        """
        Adding the menu with all possible materials users can choose

        Args:
            parent_layout  ... into which layout we should include everything
        """

        new_layout = QHBoxLayout()

        # Creating the choice of all materials and filling it with them
        self.material_combo_box = QComboBox()
        self.material_combo_box.setFont(QFont("Times", 15, QFont.Bold))
        self.material_combo_box.addItems(self.material_service.materials_name_list)

        # Trying to set a default material, which does not have to succeed
        try:
            default_material = "Iron"
            self.material_combo_box.setCurrentIndex(
                self.material_service.materials_name_list.index(default_material))
        except ValueError:
            print("{} was not found in the material list!".format(default_material))

        # Defining tooltips for each material containing their properties
        for index, material in enumerate(self.material_service.materials_name_list):
            properties = self.material_service.materials_properties_dict[material]
            info = "{} - {}".format(material, str(properties))
            self.material_combo_box.setItemData(index, info, Qt.ToolTipRole)

        label = QLabel("Material: ")
        label.setFont(QFont("Times", 15, QFont.Bold))

        custom_material_button = QPushButton("Custom", self)
        custom_material_button.clicked.connect(self.get_custom_material)

        new_layout.addWidget(label)
        new_layout.addWidget(self.material_combo_box)
        new_layout.addWidget(custom_material_button)

        parent_layout.addLayout(new_layout)

        Adding the menu with all possible materials users can choose

        Args:
            parent_layout  ... into which layout we should include everything
        
Adding the menu with all possible materials users can choose
Args:
parent_layout  ... into which layout we should include everything
Adding the menu with all possible materials users can choose Args : parent_layout ... into which layout we should include everything
def add_material_choice(self, parent_layout) -> None:
        new_layout = QHBoxLayout()
        self.material_combo_box = QComboBox()
        self.material_combo_box.setFont(QFont("Times", 15, QFont.Bold))
        self.material_combo_box.addItems(self.material_service.materials_name_list)
        try:
            default_material = "Iron"
            self.material_combo_box.setCurrentIndex(
                self.material_service.materials_name_list.index(default_material))
        except ValueError:
            print("{} was not found in the material list!".format(default_material))
        for index, material in enumerate(self.material_service.materials_name_list):
            properties = self.material_service.materials_properties_dict[material]
            info = "{} - {}".format(material, str(properties))
            self.material_combo_box.setItemData(index, info, Qt.ToolTipRole)
        label = QLabel("Material: ")
        label.setFont(QFont("Times", 15, QFont.Bold))
        custom_material_button = QPushButton("Custom", self)
        custom_material_button.clicked.connect(self.get_custom_material)
        new_layout.addWidget(label)
        new_layout.addWidget(self.material_combo_box)
        new_layout.addWidget(custom_material_button)
        parent_layout.addLayout(new_layout)
def add_material_choice ( self , parent_layout ) -> None : new_layout = QHBoxLayout ( ) self . material_combo_box = QComboBox ( ) self . material_combo_box . setFont ( QFont ( "Times" , 15 , QFont . Bold ) ) self . material_combo_box . addItems ( self . material_service . materials_name_list ) try : default_material = "Iron" self . material_combo_box . setCurrentIndex ( self . material_service . materials_name_list . index ( default_material ) ) except ValueError : print ( "{} was not found in the material list!" . format ( default_material ) ) for index , material in enumerate ( self . material_service . materials_name_list ) : properties = self . material_service . materials_properties_dict [ material ] info = "{} - {}" . format ( material , str ( properties ) ) self . material_combo_box . setItemData ( index , info , Qt . ToolTipRole ) label = QLabel ( "Material: " ) label . setFont ( QFont ( "Times" , 15 , QFont . Bold ) ) custom_material_button = QPushButton ( "Custom" , self ) custom_material_button . clicked . connect ( self . get_custom_material ) new_layout . addWidget ( label ) new_layout . addWidget ( self . material_combo_box ) new_layout . addWidget ( custom_material_button ) parent_layout . addLayout ( new_layout )
Adding the menu with all possible materials users can choose
Args:
parent_layout  ... into which layout we should include everything
Adding the menu with all possible materials users can choose Args : parent_layout ... into which layout we should include everything
"""
        Adding the menu with all possible materials users can choose

        Args:
            parent_layout  ... into which layout we should include everything
        """ # Creating the choice of all materials and filling it with them # Trying to set a default material, which does not have to succeed # Defining tooltips for each material containing their properties
self
parent_layout