| 111 | QMenu *hlSubMenu = nullptr; |
| 112 | QString currentGroup; |
| 113 | foreach (const auto &def, s_repository->definitions()) { |
| 114 | if (def.isHidden() || def.section().isEmpty()) |
| 115 | continue; |
| 116 | |
| 117 | if (currentGroup != def.section()) { |
| 118 | currentGroup = def.section(); |
| 119 | hlSubMenu = hlGroupMenu->addMenu(def.translatedSection()); |
| 120 | } |
| 121 | |
| 122 | Q_ASSERT(hlSubMenu); |
| 123 | if (hlSubMenu) { |
| 124 | auto action = hlSubMenu->addAction(def.translatedName()); |
| 125 | action->setCheckable(true); |
| 126 | action->setData(def.name()); |
| 127 | hlActionGroup->addAction(action); |
| 128 | if (def.name() == m_highlighter->definition().name()) { |
| 129 | action->setChecked(true); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | connect(hlActionGroup, &QActionGroup::triggered, this, &CodeEditor::syntaxSelected); |
| 134 | #endif |
| 135 |
nothing calls this directly
no test coverage detected