* @brief Displays the given text in the main window text browser, optionally * marking it as an error and/or rendering it as HTML. * @example * MainWindow window; * window.flashText("Operation completed.", false, false); * * @param const QString &text - The text content to display. * @param const bool isError - If true, sets the text color to red before * displaying the text. * @param con
| 232 | * @return void - No return value. |
| 233 | */ |
| 234 | void MainWindow::flashText(const QString &text, const bool isError, |
| 235 | const bool isHtml) { |
| 236 | if (isError) { |
| 237 | ui->textBrowser->setTextColor(Qt::red); |
| 238 | } |
| 239 | |
| 240 | if (isHtml) { |
| 241 | QString _text = text; |
| 242 | if (!ui->textBrowser->toPlainText().isEmpty()) { |
| 243 | _text = ui->textBrowser->toHtml() + _text; |
| 244 | } |
| 245 | ui->textBrowser->setHtml(_text); |
| 246 | } else { |
| 247 | ui->textBrowser->setText(text); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** |
| 252 | * @brief MainWindow::config pops up the configuration screen and handles all |
no outgoing calls
no test coverage detected