Skip to content
Snippets Groups Projects
Commit ceb488c8 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Work around a warning in the QColor constructor

The warning shows when passing an empty string to the constructor of a
QColor. It has been removed again, but still made it into the alpha, so
let's work it around for now.

Reviewed-by: con
parent 0b6799b9
No related branches found
No related tags found
No related merge requests found
......@@ -265,8 +265,17 @@ void ColorSchemeReader::readStyle()
bool italic = attr.value(QLatin1String("italic")) == QLatin1String(trueString);
Format format;
format.setForeground(QColor(foreground));
format.setBackground(QColor(background));
if (QColor::isValidColor(foreground))
format.setForeground(QColor(foreground));
else
format.setForeground(QColor());
if (QColor::isValidColor(background))
format.setBackground(QColor(background));
else
format.setBackground(QColor());
format.setBold(bold);
format.setItalic(italic);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment