* @brief Force-flushes the current editor text to the selected painter group. */
| 215 | * @brief Force-flushes the current editor text to the selected painter group. |
| 216 | */ |
| 217 | void DataModel::PainterCodeEditor::commit() |
| 218 | { |
| 219 | if (m_readingCode) |
| 220 | return; |
| 221 | |
| 222 | if (auto* ime = QGuiApplication::inputMethod()) { |
| 223 | if (ime->isVisible() || !ime->inputItemRectangle().isEmpty()) |
| 224 | ime->commit(); |
| 225 | } |
| 226 | |
| 227 | auto& editor = DataModel::ProjectEditor::instance(); |
| 228 | if (!editor.currentGroupIsPainter()) |
| 229 | return; |
| 230 | |
| 231 | editor.setCurrentGroupPainterCode(text()); |
| 232 | } |
| 233 | |
| 234 | /** |
| 235 | * @brief Selects all editor text. |
no test coverage detected