Add a comment explaining the need for current_text

This commit is contained in:
Kovid Goyal 2023-05-29 13:50:48 +05:30
parent 1b6fc0668d
commit a4e68799ae
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -519,6 +519,9 @@ class EditWithComplete(EnComboBox):
self.setText(text) self.setText(text)
self.selectAll() 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) current_text = pyqtProperty(str, fget=text, fset=set_current_text, user=True)
def selectAll(self): def selectAll(self):