summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstatictext/tst_qstatictext.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-09-13 10:26:03 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-09-13 10:46:16 (GMT)
commit06dc8791a70329dc8e985a0eed7e434d1f762ec5 (patch)
treef3a9f55307207088676d4c48ec67ec418fa56053 /tests/auto/qstatictext/tst_qstatictext.cpp
parent59a2ff150795e1281e6b4fea435e74d3434a5ad2 (diff)
parent31cc0b1820c0c8fdfdbc3d5b804f2dba2051c96f (diff)
downloadQt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.zip
Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.gz
Qt-06dc8791a70329dc8e985a0eed7e434d1f762ec5.tar.bz2
Merge remote branch 'qt/master' into lighthouse-master
Conflicts: configure src/corelib/global/qglobal.h src/corelib/tools/qsimd.cpp
Diffstat (limited to 'tests/auto/qstatictext/tst_qstatictext.cpp')
-rw-r--r--tests/auto/qstatictext/tst_qstatictext.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp
index 6498ae4..49d6633 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();
@@ -107,6 +109,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()
{