def set_tag_name_completer(self):
"""
set completer to tag_names_line_edit
:return:
"""
# change button icon
add_icon = QIcon()
add_icon.addPixmap(QPixmap(self.config.images + '/add.png'), QIcon.Normal, QIcon.Off)
self.add_tag_button.setIcon(add_icon)
self.add_tag_button.setToolTip("add tag")
self.tag_names_line_edit.setPlaceholderText("Tag Names")
self.tag_layout.insertWidget(0, self.tag_names_line_edit)
self.tag_list = self.dBCommandLineHelper.query_tag_all() # get all tags
tag_name_list = []
for tag in self.tag_list:
tag_name_list.append(tag.name)
cmp = TagCompleter(tag_name_list)
self.tag_names_line_edit.setCompleter(cmp)
评论列表
文章目录