summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-02 16:34:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-02 16:34:00 (GMT)
commitb22e564844fdba82ddea665c55d0498a4caa1b14 (patch)
treee12aa66748f464983522595fcecb201d124a25c2 /tests
parentb26bdb1ee896af0dd0dfc0ec3fbb6714504c3d8d (diff)
parent4778af08ca848c82526305c66dc23bb6b732b944 (diff)
downloadQt-b22e564844fdba82ddea665c55d0498a4caa1b14.zip
Qt-b22e564844fdba82ddea665c55d0498a4caa1b14.tar.gz
Qt-b22e564844fdba82ddea665c55d0498a4caa1b14.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QDesktopServices crashes when accessing the NULL X11 variable Revert "Fix the byte order in QImage::fill for 24bpp formats" Fix crash when setting font decorations on text drawn with QStaticText Fix tst_QPainter::drawImage_task258776 Fix the rendering of lines with the X11 paint engine Fix the byte order in QImage::fill for 24bpp formats QScript: remove JSC::JSLock QScript: document/obsolete things that does not work since the move to JSC
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index f358681..2cbb9b2 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -118,10 +118,12 @@ private slots:
void drawLine_task190634();
void drawLine_task229459();
void drawLine_task234891();
+ void drawHorizontalLineF();
void drawRect_data() { fillData(); }
void drawRect();
void drawRect2();
+ void drawRectFHorizontalLine();
void fillRect();
void fillRect2();
@@ -251,6 +253,7 @@ private slots:
void setPenColorOnPixmap();
void QTBUG5939_attachPainterPrivate();
+ void drawHorizontalLine();
private:
void fillData();
@@ -1218,6 +1221,26 @@ void tst_QPainter::drawLine_task234891()
QCOMPARE(expected, img);
}
+void tst_QPainter::drawHorizontalLineF()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.drawLine(QLineF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.drawLine(QLineF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
void tst_QPainter::drawLine_task216948()
{
QImage img(1, 10, QImage::Format_ARGB32_Premultiplied);
@@ -1302,6 +1325,26 @@ void tst_QPainter::drawRect2()
}
}
+void tst_QPainter::drawRectFHorizontalLine()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.drawRect(QRectF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.drawRect(QRectF(1.5f, 1.5f, 98.5f, 1.5f));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
void tst_QPainter::fillRect()
{
QImage image(100, 100, QImage::Format_ARGB32_Premultiplied);
@@ -4522,6 +4565,28 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate()
QCOMPARE(widget->deviceTransform, proxy->deviceTransform);
}
+void tst_QPainter::drawHorizontalLine()
+{
+ QPixmap pixmap(100, 3);
+ pixmap.fill();
+
+ {
+ QPainter painter(&pixmap);
+ painter.translate(0.3, 0.3);
+ painter.drawLine(QLine(1, 1, 99, 1));
+ }
+
+ QImage refImage(100, 3, QImage::Format_ARGB32);
+ refImage.fill(0xFFFFFFFF);
+ {
+ QPainter painter(&refImage);
+ painter.translate(0.3, 0.3);
+ painter.drawLine(QLine(1, 1, 99, 1));
+ }
+
+ QCOMPARE(pixmap.toImage().convertToFormat(QImage::Format_ARGB32), refImage);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"