window.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:gtrans-web-gui 作者: takiyu 项目源码 文件源码
def _init_candidate_list(self):
        self.cand_list = QtWidgets.QListWidget(self)

        # Double click or press enter to insert
        self.cand_list.itemDoubleClicked.connect(self._set_from_list)
        self.cand_list.focusOutEvent = lambda _: self.cand_list.hide()

        # The abbreviation for that language
        self.candidates = {
            "Auto": "auto", "Arabic": "ar", "Chinese": "zh-CN",
            "English": "en", "Esperanto": "eo", "French": "fr",
            "German": "de", "Greek": "el", "Italian": "it",
            "Japanese": "ja", "Korean": "ko", "Latin": "la",
            "Portugese": "pt-PT", "Russian": "ru", "Spanish": "es",
        }

        for candidate in self.candidates.keys():
            QtWidgets.QListWidgetItem(candidate, self.cand_list)

        self.cand_list.setGeometry(100, 100, 250, 300)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号