MCPcopy Create free account
hub / github.com/IJHack/QtPass / flashText

Method flashText

src/mainwindow.cpp:234–249  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

232 * @return void - No return value.
233 */
234void 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

Callers 4

mountWebDavMethod · 0.80
processErrorMethod · 0.80
processErrorExitMethod · 0.80
showInTextBrowserMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected