* @brief Loads the painter code from the currently selected group. */
| 324 | * @brief Loads the painter code from the currently selected group. |
| 325 | */ |
| 326 | void DataModel::PainterCodeEditor::readCode() |
| 327 | { |
| 328 | if (m_readingCode) |
| 329 | return; |
| 330 | |
| 331 | m_readingCode = true; |
| 332 | |
| 333 | auto& editor = DataModel::ProjectEditor::instance(); |
| 334 | QString code = editor.currentGroupPainterCode(); |
| 335 | if (code.isEmpty()) |
| 336 | code = defaultTemplate(); |
| 337 | |
| 338 | m_widget.setPlainText(code); |
| 339 | m_widget.document()->clearUndoRedoStacks(); |
| 340 | m_widget.document()->setModified(false); |
| 341 | |
| 342 | m_readingCode = false; |
| 343 | Q_EMIT modifiedChanged(); |
| 344 | } |
| 345 | |
| 346 | /** |
| 347 | * @brief Reads the painter template manifest and returns the `datasets` array |
nothing calls this directly
no test coverage detected