QssParser: Interpret "oblique" as italic
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Thu, 19 Jul 2018 20:51:54 +0000 (22:51 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 24 Jul 2018 21:03:17 +0000 (23:03 +0200)
This is better than nothing.

src/uisupport/qssparser.cpp

index d42b651..166648f 100644 (file)
@@ -728,9 +728,9 @@ void QssParser::parseFont(const QString &value, QTextCharFormat *format)
             format->setFontItalic(true);
         else if (prop == "underline")
             format->setFontUnderline(true);
             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 == "oblique")
+            // Oblique is not a property supported by QTextCharFormat
+            format->setFontItalic(true);
         else if (prop == "bold")
             format->setFontWeight(QFont::Bold);
         else { // number
         else if (prop == "bold")
             format->setFontWeight(QFont::Bold);
         else { // number
@@ -758,9 +758,9 @@ void QssParser::parseFontStyle(const QString &value, QTextCharFormat *format)
         format->setFontUnderline(true);
     else if (value == "strikethrough")
         format->setFontStrikeOut(true);
         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 if(value == "oblique")
+        // Oblique is not a property supported by QTextCharFormat
+        format->setFontItalic(true);
     else {
         qWarning() << Q_FUNC_INFO << tr("Invalid font style specification: %1").arg(value);
     }
     else {
         qWarning() << Q_FUNC_INFO << tr("Invalid font style specification: %1").arg(value);
     }