From a4e68799aeee7e32d2ec746f4c06c018c0c855e6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 29 May 2023 13:50:48 +0530 Subject: [PATCH] Add a comment explaining the need for current_text --- src/calibre/gui2/complete2.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index 945bf5d707..9e4c2b72b0 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -519,6 +519,9 @@ class EditWithComplete(EnComboBox): self.setText(text) self.selectAll() + # Create a Qt user property for the current text so that when this widget + # is used as an edit widget in a table view it selects all text, as + # matching the behavior of all other Qt widgets. current_text = pyqtProperty(str, fget=text, fset=set_current_text, user=True) def selectAll(self):