| 219 | } |
| 220 | |
| 221 | void MainWindow::performConnections() |
| 222 | { |
| 223 | connect(m_codeSampleCombobox, |
| 224 | QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 225 | [this](int index) { |
| 226 | m_codeEditor->setPlainText(m_codeSamples[index].second); |
| 227 | }); |
| 228 | |
| 229 | connect(m_highlighterCombobox, |
| 230 | QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 231 | [this](int index) { |
| 232 | m_codeEditor->setHighlighter(m_highlighters[index].second); |
| 233 | }); |
| 234 | |
| 235 | connect(m_completerCombobox, |
| 236 | QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 237 | [this](int index) { |
| 238 | m_codeEditor->setCompleter(m_completers[index].second); |
| 239 | }); |
| 240 | |
| 241 | connect(m_styleCombobox, QOverload<int>::of(&QComboBox::currentIndexChanged), |
| 242 | [this](int index) { |
| 243 | m_codeEditor->setSyntaxStyle(m_styles[index].second); |
| 244 | }); |
| 245 | |
| 246 | connect(m_readOnlyCheckBox, &QCheckBox::stateChanged, |
| 247 | [this](int state) { m_codeEditor->setReadOnly(state != 0); }); |
| 248 | |
| 249 | connect(m_wordWrapCheckBox, &QCheckBox::stateChanged, [this](int state) { |
| 250 | if (state != 0) |
| 251 | { |
| 252 | m_codeEditor->setWordWrapMode(QTextOption::WordWrap); |
| 253 | } |
| 254 | else |
| 255 | { |
| 256 | m_codeEditor->setWordWrapMode(QTextOption::NoWrap); |
| 257 | } |
| 258 | }); |
| 259 | |
| 260 | connect(m_parenthesesEnabledCheckbox, &QCheckBox::stateChanged, |
| 261 | [this](int state) { m_codeEditor->setAutoParentheses(state != 0); }); |
| 262 | |
| 263 | connect(m_tabReplaceEnabledCheckbox, &QCheckBox::stateChanged, |
| 264 | [this](int state) { m_codeEditor->setTabReplace(state != 0); }); |
| 265 | |
| 266 | connect(m_tabReplaceNumberSpinbox, |
| 267 | QOverload<int>::of(&QSpinBox::valueChanged), |
| 268 | [this](int value) { m_codeEditor->setTabReplaceSize(value); }); |
| 269 | |
| 270 | connect(m_autoIndentationCheckbox, &QCheckBox::stateChanged, |
| 271 | [this](int state) { m_codeEditor->setAutoIndentation(state != 0); }); |
| 272 | } |
nothing calls this directly
no test coverage detected