From b120cc9c03d7715ce52580619040ee5b515ed4a4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 26 May 2023 11:47:59 +0530 Subject: [PATCH] Harmonize selectall behavior for delegated editors in the book list with other places these editors are used By not having special selectAll behavior in the book list we can control this system wide by changing the widget's initial selectall behavior centrally. --- src/calibre/gui2/library/delegates.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index 63a8b954bb..546178051f 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -318,7 +318,6 @@ class TextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ def setEditorData(self, editor, index): editor.setText(get_val_for_textlike_columns(index)) - editor.selectAll() def setModelData(self, editor, model, index): if isinstance(editor, EditWithComplete): @@ -383,7 +382,6 @@ class CompleteDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ def setEditorData(self, editor, index): editor.setText(get_val_for_textlike_columns(index)) - editor.selectAll() def setModelData(self, editor, model, index): if isinstance(editor, EditWithComplete): @@ -493,12 +491,10 @@ class CcTextDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ text = index.data(Qt.ItemDataRole.DisplayRole) if text: editor.setText(text) - editor.selectAll() return editor def setEditorData(self, editor, index): editor.setText(get_val_for_textlike_columns(index)) - editor.selectAll() def setModelData(self, editor, model, index): val = editor.text() or ''