┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/servicemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/servicemodel.cpp')
-rw-r--r--src/settings/servicemodel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/settings/servicemodel.cpp b/src/settings/servicemodel.cpp
index 07a804e33..5333e88b9 100644
--- a/src/settings/servicemodel.cpp
+++ b/src/settings/servicemodel.cpp
@@ -29,7 +29,7 @@ bool ServiceModel::insertRows(int row, int count, const QModelIndex &parent)
beginInsertRows(parent, row, row + count - 1);
for (int i = 0; i < count; ++i) {
ServiceItem item;
- item.checked = false;
+ item.checked = Qt::Unchecked;
item.configurable = false;
m_items.insert(row, item);
}
@@ -47,7 +47,7 @@ bool ServiceModel::setData(const QModelIndex &index, const QVariant &value, int
switch (role) {
case Qt::CheckStateRole:
- m_items[row].checked = value.toBool();
+ m_items[row].checked = value.value<Qt::CheckState>();
break;
case ConfigurableRole:
m_items[row].configurable = value.toBool();
@@ -105,4 +105,9 @@ void ServiceModel::clear()
endRemoveRows();
}
+Qt::ItemFlags ServiceModel::flags(const QModelIndex &index) const
+{
+ return QAbstractListModel::flags(index) | Qt::ItemIsUserCheckable;
+}
+
#include "moc_servicemodel.cpp"