group_actions_window.py 文件源码

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

项目:Enibar 作者: ENIB 项目源码 文件源码
def selection_changed(self):
        selected = [obj.text() for obj in self.note_list.selectedItems()]
        to_del = []

        if len(selected) > len(self.selected_notes):  # Something was added
            for note in selected:
                if note not in self.selected_notes:
                    cb = QtWidgets.QComboBox()
                    cb.addItems(["1/4", "1/2"] + list(map(str, range(1, 11))))
                    cb.setCurrentIndex(2)

                    item = QtWidgets.QTreeWidgetItem(self.selected_notes_report, [note, "1"])
                    self.selected_notes_report.setItemWidget(item, 1, cb)
                    item.setFlags(QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled)
                    self.selected_notes[note] = item
        else:
            for note in self.selected_notes:
                if note not in selected:
                    to_del.append(note)

        for note in to_del:
            item = self.selected_notes[note]
            del self.selected_notes[note]
            sip.delete(item)

        self.note_list.search_input.clear()
        self.note_list.search_input.setFocus(True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号