X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fqssparser.cpp;h=3e5cd8edd19ed69308f5b64bb05e2b34e0cb6437;hp=07dab3a8e02b799037b36291c12f8fd2a1ae2bd5;hb=f56f4515fa722a9e20bca9457ff876e1a0a5f38c;hpb=374bb1f45bed3d21ad9abd7343bf0d2fc8a56fbc diff --git a/src/uisupport/qssparser.cpp b/src/uisupport/qssparser.cpp index 07dab3a8..3e5cd8ed 100644 --- a/src/uisupport/qssparser.cpp +++ b/src/uisupport/qssparser.cpp @@ -322,6 +322,8 @@ std::pair QssParser::parseFormatType fmtType |= FormatType::Italic; else if (condValue == "underline") fmtType |= FormatType::Underline; + else if (condValue == "strikethrough") + fmtType |= FormatType::Strikethrough; else { qWarning() << Q_FUNC_INFO << tr("Invalid format name: %1").arg(condValue); return invalid; @@ -713,7 +715,7 @@ QGradientStops QssParser::parseGradientStops(const QString &str_) void QssParser::parseFont(const QString &value, QTextCharFormat *format) { - static const QRegExp rx("((?:(?:normal|italic|oblique|underline|bold|100|200|300|400|500|600|700|800|900) ){0,2}) ?(\\d+)(pt|px)? \"(.*)\""); + static const QRegExp rx("((?:(?:normal|italic|oblique|underline|strikethrough|bold|100|200|300|400|500|600|700|800|900) ){0,2}) ?(\\d+)(pt|px)? \"(.*)\""); if (!rx.exactMatch(value)) { qWarning() << Q_FUNC_INFO << tr("Invalid font specification: %1").arg(value); return; @@ -726,6 +728,7 @@ void QssParser::parseFont(const QString &value, QTextCharFormat *format) format->setFontItalic(true); else if (prop == "underline") format->setFontUnderline(true); + // Oblique is not a property supported by QTextCharFormat //else if(prop == "oblique") // format->setStyle(QFont::StyleOblique); else if (prop == "bold") @@ -753,6 +756,9 @@ void QssParser::parseFontStyle(const QString &value, QTextCharFormat *format) format->setFontItalic(true); else if (value == "underline") format->setFontUnderline(true); + else if (value == "strikethrough") + format->setFontStrikeOut(true); + // Oblique is not a property supported by QTextCharFormat //else if(value == "oblique") // format->setStyle(QFont::StyleOblique); else {