Closed witech-king closed 1 year ago
Describe the bug QCompleter过多导致检索卡顿
Environment 环境信息
To Reproduce items长度为3866出现卡顿要8s 耗时代码\qfluentwidgets\components\widgets\line_edit setCompletion
for i in items: self.addAction(QAction(i, triggered=lambda c, x=i: self.lineEdit.setText(x)))
Code 最小复现代码
# Minimum code to reproduce the error class CSearchLineedit(SearchLineEdit): def __init__(self, parent=None): super(CSearchLineedit, self).__init__(parent) self.setClearButtonEnabled(True) def set_completer(self, search_info_list): search_completer = QCompleter(search_info_list, self) search_completer.setCaseSensitivity(Qt.CaseInsensitive) search_completer.setFilterMode(Qt.MatchContains) self.setCompleter(search_completer)
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
复现视频
https://github.com/zhiyiYo/PyQt-Fluent-Widgets/assets/137036346/2ca6707b-c7b1-4733-bb1b-6714c6440acf
目前已修复此问题,延迟为 0
Describe the bug QCompleter过多导致检索卡顿
Environment 环境信息
To Reproduce items长度为3866出现卡顿要8s 耗时代码\qfluentwidgets\components\widgets\line_edit setCompletion
Code 最小复现代码
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.