From b53d0d5dab40e15d56ed259c255fd9aaec44285f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 Dec 2020 11:33:36 +0530 Subject: [PATCH] More stupid PyQt enums --- src/calibre/gui2/search_box.py | 4 ++-- src/calibre/gui2/widgets.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index a41ffa7c09..6ec227504b 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -138,7 +138,7 @@ class SearchBox2(QComboBox): # {{{ self.timer = QTimer() self.timer.setSingleShot(True) self.timer.timeout.connect(self.timer_event, type=Qt.ConnectionType.QueuedConnection) - self.setInsertPolicy(self.NoInsert) + self.setInsertPolicy(QComboBox.InsertPolicy.NoInsert) self.setMaxCount(self.MAX_COUNT) self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(25) @@ -342,7 +342,7 @@ class SavedSearchBox(QComboBox): # {{{ self.setCompleter(completer) self.setEditable(True) - self.setInsertPolicy(self.NoInsert) + self.setInsertPolicy(QComboBox.InsertPolicy.NoInsert) self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(10) self.tool_tip_text = self.toolTip() diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index 2230d45969..bfc4682046 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -672,7 +672,7 @@ class HistoryLineEdit(QComboBox): # {{{ def __init__(self, *args): QComboBox.__init__(self, *args) self.setEditable(True) - self.setInsertPolicy(self.NoInsert) + self.setInsertPolicy(QComboBox.InsertPolicy.NoInsert) self.setMaxCount(10) self.setClearButtonEnabled = self.lineEdit().setClearButtonEnabled self.textChanged = self.editTextChanged