def METHOD_NAME(self):
    # Layout for buttons
    buttons = QtWidgets.QDialogButtonBox()
    self.cancel_button = buttons.addButton(QtWidgets.QDialogButtonBox.Cancel)
    self.delete_button = buttons.addButton(
        "Delete", QtWidgets.QDialogButtonBox.AcceptRole
    )
    buttons_layout = QtWidgets.QHBoxLayout()
    buttons_layout.addWidget(buttons, alignment=QtCore.Qt.AlignTop)
    buttons_layout_widget = QtWidgets.QWidget()
    buttons_layout_widget.setLayout(buttons_layout)
    # Connect actions for buttons
    buttons.accepted.connect(self.accept)
    buttons.rejected.connect(self.reject)
    return buttons_layout_widget