ImportError:无法导入名称选项TranusDialog

2024-07-02 12:15:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个奇怪的问题:ImportError:无法导入name OptionsTRANUSDialog 在file OptionsTRANUSDialog中,我可以通过以下方法获取我的checked_list:

    model = self.scenarios.model()
    checked_indexes = model.match(model.index(0, 0), QtCore.Qt.CheckStateRole,QtCore.Qt.Checked, -1,QtCore.Qt.MatchExactly | QtCore.Qt.MatchRecursive)

    for index in checked_indexes:
        item = model.itemFromIndex(index)
        item_text = item.text()
        self.checked_list.append(item_text)

    if self.checked_list != [] :
        dialog = LaunchTRANUSDialog(parent=self)
        dialog.show()
        result = dialog.exec_()

我想在另一个文件中使用这个选中的\u列表(launch_tranus_对话框),所以我将导入放在这个文件中:

^{pr2}$

当我执行时,我得到了一个错误: ImportError:无法导入名称选项TranusDialog

我真的不明白这个导入错误。在

你能帮帮我吗。在

谢谢。在


Tags: 文件textselfindexmodel错误itemqt