diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-03-03 12:34:27 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-03-03 17:20:25 +0100 |
commit | ceb488c865090e349076cbc0a8e929329098d16a (patch) | |
tree | 0b88462bd5785fb930cbb53be519573a15729e36 /src/plugins/texteditor/colorscheme.cpp | |
parent | 0b6799b9942106d1b4a8265a9777e77ebef9e7dc (diff) |
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
Diffstat (limited to 'src/plugins/texteditor/colorscheme.cpp')
-rw-r--r-- | src/plugins/texteditor/colorscheme.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/texteditor/colorscheme.cpp b/src/plugins/texteditor/colorscheme.cpp index 51b6e67a8cd..61511c3d2c0 100644 --- a/src/plugins/texteditor/colorscheme.cpp +++ b/src/plugins/texteditor/colorscheme.cpp @@ -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); |