| Summary: | Give BasicListItem the ability to display a checkbox | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kirigami | Reporter: | Nate Graham <nate> |
| Component: | general | Assignee: | Nate Graham <nate> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.70.0 | ||
| Target Milestone: | Not decided | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/89 We now have a subclass called CheckableListitem which provides this. |
The parent item (AbstractListItem) can already be checkable. It would be nice if the list item itself would display a checkbox for this case. Something like this I guess: diff --git src/controls/BasicListItem.qml src/controls/BasicListItem.qml index 2591a5c..968413d 100644 --- src/controls/BasicListItem.qml +++ src/controls/BasicListItem.qml @@ -87,6 +87,13 @@ AbstractListItem { contentItem: RowLayout { id: layout spacing: LayoutMirroring.enabled ? listItem.rightPadding : listItem.leftPadding + QQC2.CheckBox { + visible: listItem.checkable + checked: visible ? listItem.checked : undefined + onToggled: { + listItem.action.checked = true; + } + } Icon { id: iconItem source: {