src/declarative/util/qdeclarativestyledtext.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   150                 }
   150                 }
   151             } else {
   151             } else {
   152                 QTextCharFormat format;
   152                 QTextCharFormat format;
   153                 if (formatStack.count())
   153                 if (formatStack.count())
   154                     format = formatStack.top();
   154                     format = formatStack.top();
   155                 else
       
   156                     format.setFont(baseFont);
       
   157                 if (parseTag(ch, text, drawText, format))
   155                 if (parseTag(ch, text, drawText, format))
   158                     formatStack.push(format);
   156                     formatStack.push(format);
   159             }
   157             }
   160             textStart = ch - text.constData() + 1;
   158             textStart = ch - text.constData() + 1;
   161             textLength = 0;
   159             textLength = 0;
   196             QStringRef tag(&textIn, tagStart, tagLength);
   194             QStringRef tag(&textIn, tagStart, tagLength);
   197             const QChar char0 = tag.at(0);
   195             const QChar char0 = tag.at(0);
   198             if (char0 == QLatin1Char('b')) {
   196             if (char0 == QLatin1Char('b')) {
   199                 if (tagLength == 1)
   197                 if (tagLength == 1)
   200                     format.setFontWeight(QFont::Bold);
   198                     format.setFontWeight(QFont::Bold);
   201                 else if (tagLength == 2 && tag.at(1) == QLatin1Char('r'))
   199                 else if (tagLength == 2 && tag.at(1) == QLatin1Char('r')) {
   202                     textOut.append(QChar(QChar::LineSeparator));
   200                     textOut.append(QChar(QChar::LineSeparator));
       
   201                     return false;
       
   202                 }
   203             } else if (char0 == QLatin1Char('i')) {
   203             } else if (char0 == QLatin1Char('i')) {
   204                 if (tagLength == 1)
   204                 if (tagLength == 1)
   205                     format.setFontItalic(true);
   205                     format.setFontItalic(true);
   206             }
   206             }
   207             return true;
   207             return true;