Replace newlines with HTML line breaks in message dialogs

* Keeps readability of translation strings without losing line breaks due to forced rich text display
This commit is contained in:
Jonathan White committed 2025-06-19 17:56:42 -04:00
1 parent 6760865487
commit bd20cd2d1d
1 file changed
+3 -1
+3 -1
View File
@@ -91,7 +91,9 @@ MessageBox::Button MessageBox::messageBox(QWidget* parent,
msgBox.setTextFormat(Qt::RichText);
msgBox.setIcon(icon);
msgBox.setWindowTitle(title);
msgBox.setText(text);
// Replace newlines with HTML line breaks
auto fixedText = text;
msgBox.setText(fixedText.replace("\n", "<br>"));
if (m_overrideParent) {
// Force the creation of the QWindow, without this windowHandle() will return nullptr