Apply Style QML
apply_style_qmlApplies a QGIS QML style to a layer from a file or inline text, supporting advanced styles such as rule-based renderers, data-defined properties, SVG fills, and blend modes.
Instructions
Apply a QGIS QML style to a layer, from a file (path) or inline QML text (qml); pass exactly one. Use it for styles the other styling tools do not model (rule-based renderers, data-defined properties, SVG fills, blend modes). Rejected, with the previous style restored, if the XML is malformed, targets the other layer kind, or QGIS loads a different renderer than the QML declares. Tip: save_style_qml on a similar layer gives a template in this QGIS version's format.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"layer_id": "<layer_id>"
},
"name": "apply_style_qml"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qml | No | ||
| path | No | ||
| layer_id | Yes |