Commit 5854a5ae authored by Volker Krause's avatar Volker Krause
Browse files

Pass icons by name rather than as QIcon from C++ to QML

With Qt 6, BasicListItem can't consume QIcon directly anymore as we have
to go through the QQuickIcon property of its base class.
parent 1d271095
Pipeline #226260 passed with stage
in 1 minute and 5 seconds
......@@ -43,6 +43,7 @@ QHash<int, QByteArray> MenuModel::roleNames() const
names[IsCategoryRole] = "IsCategoryRole";
names[IsKCMRole] = "IsKCMRole";
names[DefaultIndicatorRole] = "showDefaultIndicator";
names[IconNameRole] = "iconName";
return names;
}
......@@ -142,6 +143,9 @@ QVariant MenuModel::data(const QModelIndex &index, int role) const
case MenuModel::DefaultIndicatorRole:
theData.setValue(mi->showDefaultIndicator());
break;
case MenuModel::IconNameRole:
theData.setValue(mi->iconName());
break;
default:
break;
}
......
......@@ -49,6 +49,8 @@ public:
IsKCMRole,
DefaultIndicatorRole,
IconNameRole,
};
/**
......
......@@ -21,7 +21,7 @@ Kirigami.BasicListItem {
}
leadingPadding: 0
icon: model.decoration
icon: model.iconName
text: model.display
Accessible.name: model.display
......
......@@ -94,7 +94,7 @@ Rectangle {
id: mostUsedRepeater
model: systemsettings.mostUsedModel
delegate: IntroIcon {
icon: model.decoration
icon: model.iconName
text: model.display
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment