We need to specify the width manually when porting to ItemDelegate. Also
we can port to CheckDelegate instead here since it does exactly the same
thing as the old list item's custom content item.

CCMAIL: notmart@gmail.com
This commit is contained in:
Nate Graham 2023-11-03 12:13:48 -06:00
parent 55100ddbcc
commit 40b2dedb2c

View file

@ -8,7 +8,6 @@ import QtQuick 2.7
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls 2.11 as QQC2 import QtQuick.Controls 2.11 as QQC2
import org.kde.kirigami 2.10 as Kirigami
import org.kde.kcmutils as KCM import org.kde.kcmutils as KCM
import org.kde.kitemmodels 1.0 as KItemModel import org.kde.kitemmodels 1.0 as KItemModel
@ -30,13 +29,12 @@ KCM.ScrollViewKCM {
sortOrder: Qt.AscendingOrder sortOrder: Qt.AscendingOrder
} }
delegate: QQC2.ItemDelegate { delegate: QQC2.CheckDelegate {
contentItem: QQC2.CheckBox { width: ListView.view.width
text: model.name text: model.name
checked: model.enabled checked: model.enabled
onCheckedChanged: { onToggled: {
model.enabled = checked model.enabled = checked
}
} }
} }
} }