def METHOD_NAME(self) -> DirsToCopySettings:
    def extract_dirs_data(root_item: QTreeWidgetItem) -> Dict[str, bool]:
        data = {}
        for i in range(root_item.childCount()):
            item = root_item.child(i)
            relative_path = item.data(0, Qt.UserRole)
            is_checked = item.checkState(0) == Qt.Checked
            data[relative_path] = is_checked
            if item.childCount() > 0:
                data.update(extract_dirs_data(item))
        return data
    METHOD_NAME = extract_dirs_data(self.dirsTreeWidget.invisibleRootItem())
    return METHOD_NAME