I'm starting to get a little bit of a handle on layouts, because I didn't initially create one. I have three layouts: header_layout (there's a button for the tools menu, a header, and a button for user login). Next comes my problematic tasks_layout layout. It should have a static 'Tasks' label at the top center, and under it a button (+) that adds a task (the same one is in the tools menu). If tasks are added, they should be vertical, each 50 pixels below the previous one, and there should be a (+) button at the very bottom after the last task. I use spacing and stretch to customize the interface, but when I add a checkbox with a task, all elements from the layout disappear and the checkbox appears at the very beginning of the layout. The buttons don't appear on the checkbox at all. I need each subsequent checkbox to appear as I described above, and if there are too many tasks, I want to add a scrollbar. Also, when I click add second task, the program crashes. When I add a task, for some reason the window expands a bit to the side. At the very bottom I have a third layout that has a statusbar made with Qlabel. def clear_layout(self, layout): while layout.count(): item = layout.takeAt(0) if item.widget(): item.widget().deleteLater() elif item.layout(): self.clear_layout(item.layout()) def show_all_task_checkboxes(self): self.clear_layout(self.tasks_layout) # title layout title_tasks_layout = QHBoxLayout() title_tasks_layout.addStretch() title_tasks_layout.addWidget(self.title_tasks_label, alignment=Qt.AlignCenter) title_tasks_layout.addStretch() self.tasks_layout.addLayout(title_tasks_layout) for checkbox, data in self.checkbox_dict.items(): checkbox_layout = QHBoxLayout() checkbox_layout.addWidget(checkbox) checkbox.show() for button in data["buttons"]: checkbox_layout.addWidget(button) button.show() self.tasks_layout.addLayout(checkbox_layout) # (+) button layout plus_button_layout = QHBoxLayout() plus_button_layout.addSpacing(75) self.add_task_plus_button.setFixedSize(50,50) plus_button_layout.addWidget(self.add_task_plus_button, alignment=Qt.AlignLeft) plus_button_layout.addStretch() self.tasks_layout.addLayout(plus_button_layout) self.set_statusbar_over_all_widgets() The code that is associated with the tasks layout above. Code with all other layouts below (you may need this too) self.central_widget = QWidget(self) self.main_layout = QVBoxLayout() self.header_layout = QHBoxLayout() self.tasks_layout = QVBoxLayout() self.statusbar_layout = QHBoxLayout() self.setCentralWidget(self.central_widget) self.central_widget.setLayout(self.main_layout) self.main_layout.setAlignment(Qt.AlignTop) self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setSpacing(0) self.main_layout.addLayout(self.header_layout,1) self.main_layout.addLayout(self.tasks_layout,4) self.main_layout.addLayout(self.statusbar_layout,1) # add to header layout self.header_layout.addWidget(self.tool_button) self.header_layout.addWidget(self.title_label) self.header_layout.addWidget(self.user_login_button) self.tool_button.setFixedSize(100,100) self.title_label.setFixedHeight(100) self.user_login_button.setFixedSize(100,100) self.tool_button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.user_login_button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.title_label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # add to tasks layout widgets and show self.tasks_layout.setAlignment(Qt.AlignTop) self.title_tasks_label.setFixedHeight(75) # self.add_task_plus_button.setFixedSize(100,100) self.show_all_task_checkboxes() # add to statusbar layout self.statusbar_layout.addWidget(self.status_label) self.status_label.setFixedHeight(25) I'd really appreciate it if you could help me out. Thank you. I tried to find a solution using AI, but it didn't work for me. I couldn't find any good videos on this topic that would help me much Continue reading...