Bug 426001

Summary: Give BasicListItem the ability to display a checkbox
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Nate Graham <nate>
Component: generalAssignee: 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:

Description Nate Graham 2020-08-30 18:17:44 UTC
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: {
Comment 1 Bug Janitor Service 2020-08-30 18:50:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/89
Comment 2 Nate Graham 2021-03-12 23:45:14 UTC
We now have a subclass called CheckableListitem which provides this.