diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-09-05 23:54:38 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-09-05 23:54:38 (GMT) |
commit | c3bf669fb7fdac530365f36750613f2e21893a77 (patch) | |
tree | 0d7ac6e135913221f94183968a599c4027b2b21e /tests/auto | |
parent | 0b5fa23dd25c78b71dfb0932008d226639a43445 (diff) | |
parent | 63e15bbb9666ab49305d45380f9f580fb0e168ca (diff) | |
download | Qt-c3bf669fb7fdac530365f36750613f2e21893a77.zip Qt-c3bf669fb7fdac530365f36750613f2e21893a77.tar.gz Qt-c3bf669fb7fdac530365f36750613f2e21893a77.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qstatictext/tst_qstatictext.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 0ae5320..2a60e9e 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -73,6 +73,8 @@ private slots: void prepareToCorrectData(); void prepareToWrongData(); + void copyConstructor(); + void translatedPainter(); void rotatedPainter(); void scaledPainter(); @@ -104,6 +106,31 @@ void tst_QStaticText::constructionAndDestruction() QStaticText text("My text"); } +void tst_QStaticText::copyConstructor() +{ + QStaticText text(QLatin1String("My text")); + + QTextOption textOption(Qt::AlignRight); + text.setTextOption(textOption); + + text.setPerformanceHint(QStaticText::AggressiveCaching); + text.setTextWidth(123.456); + text.setTextFormat(Qt::PlainText); + + QStaticText copiedText(text); + copiedText.setText(QLatin1String("Other text")); + + QCOMPARE(copiedText.textOption().alignment(), Qt::AlignRight); + QCOMPARE(copiedText.performanceHint(), QStaticText::AggressiveCaching); + QCOMPARE(copiedText.textWidth(), 123.456); + QCOMPARE(copiedText.textFormat(), Qt::PlainText); + + QStaticText otherCopiedText(copiedText); + otherCopiedText.setTextWidth(789); + + QCOMPARE(otherCopiedText.text(), QString::fromLatin1("Other text")); +} + Q_DECLARE_METATYPE(QStaticText::PerformanceHint) void tst_QStaticText::drawToPoint_data() { |