diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-02 00:30:27 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-07-02 00:30:27 (GMT) |
commit | 737b5dc88e3214e35348335120caf20732c0b5b2 (patch) | |
tree | 8a99954ac28e70b328ee4e3a11a1ab658714ca27 /tests | |
parent | a3cd7065c5b630d9d949cc53db36f5c2d091c9fc (diff) | |
parent | bc02c00130d6ebbd149caff8c21b6b1dc5c5451f (diff) | |
download | Qt-737b5dc88e3214e35348335120caf20732c0b5b2.zip Qt-737b5dc88e3214e35348335120caf20732c0b5b2.tar.gz Qt-737b5dc88e3214e35348335120caf20732c0b5b2.tar.bz2 |
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration:
Re-apply licenseheader text in source files for qt4.7
Fix QWidget::palettePropagation2() autotest on Symbian (part 2)
Fix QWidget::palettePropagation2() autotest on Symbian
QTBUG-19500 lupdate fails to run from the Mac binary package on Mac OS X 10.5
Fix text color in some cases of QML and QStaticText
Added qmlshadersplugin to Symbian s60installs.pro-file.
Fix KERN-EXEC 0 errors in symbian bearer plugin
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qstatictext/tst_qstatictext.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index e14c9db..704f19b 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -96,6 +96,9 @@ private slots: void drawUnderlinedText(); void unprintableCharacter_qtbug12614(); + + void underlinedColor_qtbug20159(); + void textDocumentColor(); }; void tst_QStaticText::init() @@ -783,5 +786,42 @@ void tst_QStaticText::unprintableCharacter_qtbug12614() QVERIFY(staticText.size().isValid()); // Force layout. Should not crash. } +void tst_QStaticText::underlinedColor_qtbug20159() +{ + QString multiScriptText; + multiScriptText += QChar(0x0410); // Cyrillic 'A' + multiScriptText += QLatin1Char('A'); + + QStaticText staticText(multiScriptText); + + QFont font; + font.setUnderline(true); + + staticText.prepare(QTransform(), font); + + QStaticTextPrivate *d = QStaticTextPrivate::get(&staticText); + QCOMPARE(d->itemCount, 2); + + // The pen should not be marked as dirty when drawing the underline + QVERIFY(!d->items[0].color.isValid()); + QVERIFY(!d->items[1].color.isValid()); +} + +void tst_QStaticText::textDocumentColor() +{ + QStaticText staticText("A<font color=\"red\">B</font>"); + staticText.setTextFormat(Qt::RichText); + staticText.prepare(); + + QStaticTextPrivate *d = QStaticTextPrivate::get(&staticText); + QCOMPARE(d->itemCount, 2); + + // The pen should not be marked as dirty when drawing the underline + QVERIFY(!d->items[0].color.isValid()); + QVERIFY(d->items[1].color.isValid()); + + QCOMPARE(d->items[1].color, QColor(Qt::red)); +} + QTEST_MAIN(tst_QStaticText) #include "tst_qstatictext.moc" |