FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix elide mode behaviour by kor44 · Pull Request #4106 · sqlitebrowser/sqlitebrowser · GitHub

Fix elide mode behaviour - #4106

Merged
mgrojo merged 3 commits into
sqlitebrowser:masterfrom
kor44:master
Mar 26, 2026
Merged

Fix elide mode behaviour#4106
mgrojo merged 3 commits into
sqlitebrowser:masterfrom
kor44:master

Conversation

kor44 commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

By default word wrap for QTableView is enabled. If cell's text include quated string or colon or dash (like date: 2025-09-01 00:00:01) then text truncated too much.
For example instead of "2005-09-01 00:00:..." truncate to "2005-09-01..."

This is SQL command to create test data

CREATE TABLE "log" (
	"UserName"	TEXT,
	"Resource"	TEXT,
	"Client Address" TEXT,
	"StartTime"	TEXT,
	"Command"	TEXT
);

INSERT INTO "log" ("UserName", "Resource", "StartTime", "Command") 
VALUES ('verylonglnguser1', 'Server-Node-23', '2026-01-22 01:53:01', 'show config:ip_addr="host_private"');

By default word wrap for QTableView is enabled. If cell's text include
quated string or colon or dash (like date: 2025-09-01 00:00:01)
then text truncated too much.
For example instead of "2005-09-01 00:00:..." truncate to
"2005-09-01..."

mgrojo commented Mar 20, 2026

Copy link
Copy Markdown
Member

Already done here conditionally:

https://github.com/kor44/sqlitebrowser/blob/53fafcb6ca564e22ed4dce4e71af2a8178fe2395/src/ExtendedTableWidget.cpp#L483-486

Should that version range changed? Is this a regression in Qt? If you tell us your Qt version, maybe it's better to adjust the check.

kor44 commented Mar 20, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

My QT version is 5.9.3. Official version uses QT 5.15.2 and has the same issue.

mgrojo commented Mar 20, 2026

Copy link
Copy Markdown
Member

OK, it's probably not related to the bug for which we inserted that check. It seems that you'd simply prefer the truncation behaviour. Ideally, when there are more than one line visible, the last line should be truncated, but the rest wrapped to the next line. But that should be done at the Qt level.

Maybe you could implement a new setting to make that user-configurable in Preferences, or implement a logic in which when only one line is visible, word wrapping is disabled, but if the user modified the height, word wrapping is applied.

kor44 commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

I added one option in Preferences

mgrojo commented Mar 22, 2026

Copy link
Copy Markdown
Member

Thanks, @kor44.

I'd do it simpler, using positive logic and call it unconditionally, that is:

setWordWrap (Settings::getValue("databrowser", "cell_word_wrap").toBool());

In that case, the text has to say "Enable word wrap in cells" with default being true.

- switch option to positive logic
- invoke unconditional setWordWrap()

kor44 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

@mgrojo, you were right. Positive logic is better.

mgrojo merged commit e53730e into sqlitebrowser:master Mar 26, 2026
21 of 23 checks passed

mgrojo commented Mar 26, 2026

Copy link
Copy Markdown
Member

Thanks, @kor44

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL