Skip to content

ListView component with multi-row selection - #37

Merged
seventil merged 61 commits into
developfrom
selectable_table_view
Oct 19, 2026
Merged

seventil merged 61 commits into
developfrom
selectable_table_view

Conversation

@seventil

@seventil seventil commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Adds a ListView component (plus ListViewHeader, ListViewDelegate, and ListViewTextInput) as a styled QtQuick ListView replacement for the existing TableView components. Column widths are managed at the ListView level via columnWidths (fixed px or -1 flex) and propagated to the header and delegates, avoiding the timer-based header label measurement of the previous approach.

The public API exposes flags to control behaviour without needing to subclass: multiSelection enables Ctrl/Shift modifier-based range and toggle selection on top of plain single-click; selectOnEdit (default false) keeps cell editing orthogonal to row selection — clicking into an inline editor never selects the row, with true restoring the legacy auto-select-on-edit behaviour. Scrollbar appearance is fully consumer-controlled via scrollBarPolicy (accepts ScrollBar.Policy directly — no custom enum) and scrollBarInteractive, which together cover indicator-style, always-on draggable, and fully hidden modes from a single ScrollBar attachment. Additional knobs: tallRows, maxRowCountShow, defaultInfoText, selectionActive, and clearSelection().

@seventil seventil self-assigned this Mar 20, 2026
@seventil seventil added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] medium Normal/default priority labels Mar 20, 2026
@seventil

Copy link
Copy Markdown
Contributor Author

The selection stays even outside the focus and I haven't made up my mind on what to do with that. Many such tables with many selections and its tiring. Maybe the user should clear selections from the buttons that are supposed to read the listview, calling the clearSelection() method.

@seventil

Copy link
Copy Markdown
Contributor Author

I'll have to wait for the scrollbars to merge to see how well the final version of this ListView works

@seventil seventil changed the title added a draft version of a new selectable table view ListView component with multi-row selection Apr 29, 2026
@codecov

codecov Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (b7a8318) to head (bc92d32).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop     #37   +/-   ##
=======================================
  Coverage     0.00%   0.00%           
=======================================
  Files            4       4           
  Lines          387     387           
=======================================
  Misses         387     387           
Flag Coverage Δ
integration 0.00% <ø> (ø)
unittests 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@seventil
seventil marked this pull request as ready for review April 30, 2026 14:19
@seventil
seventil requested a review from AndrewSazonov April 30, 2026 14:19

@AndrewSazonov AndrewSazonov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for implementing this. Looks good to me!

Just one small request here, plus a couple of notes in the code. In the old TableView, delegate cells automatically used the horizontalAlignment from the corresponding header cells, so we didn’t have to define it twice. Could we keep the same behavior as the default in this ListView, while still allowing individual delegate cells to override it?

Also, could you merge the latest develop into this branch and rerun the checks to see if that fixes the CI failures?

Comment thread src/EasyApplication/Gui/Components/ListViewHeader.qml
Comment thread src/EasyApplication/Gui/Components/ListView.qml Outdated
seventil and others added 5 commits October 12, 2026 10:46
Better explanation for selection toggle

Co-authored-by: Andrew Sazonov <AndrewSazonov@users.noreply.github.com>
…et clicks for interactive elements in the header
@seventil

Copy link
Copy Markdown
Contributor Author

Just one small request here, plus a couple of notes in the code. In the old TableView, delegate cells automatically used the horizontalAlignment from the corresponding header cells, so we didn’t have to define it twice. Could we keep the same behavior as the default in this ListView, while still allowing individual delegate cells to override it?

I added functionality to make column aligmnents, but it's implemented the same way as the widths and doesn't follow the TableView style with autoupdates (i had issues with tableview-style updates on widths and alignments).

@AndrewSazonov AndrewSazonov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@seventil
seventil merged commit ac6b2e1 into develop Oct 19, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] medium Normal/default priority [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants