Closed marcpley closed 1 week ago
I agree your proposal is more intuitive.
../guiSQLiteStudio/datagrid/fkcombobox.cpp line 113 Comment this 2 lines:
if (!value.isNull() && isEditable())
lineEdit()->selectAll();
This fix alone will apply only for columns with Foreign Key (as fkcombobox is used there). It's good, but it's not complete solution yet.
According to https://forum.qt.io/topic/51878/solved-remove-text-selection-when-qlineedit-gets-focus/4 we have to switch from vanilla QLineEdit
to our own class that extends QLineEdit
and overrides focusInEvent
.
I will try that solution.
I agree my proposal isn't good. And even for fk it's not good when wanting to replace the entire value. In fact I mixed up this enhancement and bug 5082.
I got the expected behavior by extending QLineEdit
and selecting contents conditionally (depending on how the edition was triggered).
With this db: test.sqlite3.tar.gz
browse "Cultures" table, click on "Hors serre-6B" in column "Planche"
type "no" with keyboard, auto-completion works and propose "nord-1"
if mouse click to open the foreign table grid, it's ok (corrected part of the bug).
but if you don't open the foreign table grid and type keydown key to have "Nord-1A" it don't work, you will have the first row of the foreign table: "Fruitiers-1"
Okay, I found a way to fix it. You can git pull
and verify on your side.
Details
To replace the value of a cell we have to focus the cell and simply type the new value. It's good.
To modify the value of a cell we have to focus the cell and entering it and the value is totally selected. It's not usefull because if I enter in the cell I don't want to replace it or copy it. Most often it's the end of the value that have to be modified. So, placing the cursor at the end of the value would be more ergonomic for the db users.