summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro5
-rw-r--r--tests/auto/gui/painting/qpainter/testdata.qrc186
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp18
3 files changed, 208 insertions, 1 deletions
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 752f9be1f4..7e9d438e1b 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -10,3 +10,8 @@ SOURCES += tst_qpainter.cpp
TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \
task217400.png
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+android: !android-no-sdk {
+ RESOURCES += \
+ testdata.qrc
+}
diff --git a/tests/auto/gui/painting/qpainter/testdata.qrc b/tests/auto/gui/painting/qpainter/testdata.qrc
new file mode 100644
index 0000000000..a7b8c222e5
--- /dev/null
+++ b/tests/auto/gui/painting/qpainter/testdata.qrc
@@ -0,0 +1,186 @@
+<RCC>
+ <qresource prefix="/">
+ <file>task217400.png</file>
+ <file>drawEllipse/10x10SizeAt0x0.png</file>
+ <file>drawEllipse/10x10SizeAt100x100.png</file>
+ <file>drawEllipse/10x10SizeAt200x200.png</file>
+ <file>drawEllipse/13x100SizeAt0x0.png</file>
+ <file>drawEllipse/13x100SizeAt100x100.png</file>
+ <file>drawEllipse/13x100SizeAt200x200.png</file>
+ <file>drawEllipse/200x200SizeAt0x0.png</file>
+ <file>drawEllipse/200x200SizeAt100x100.png</file>
+ <file>drawEllipse/200x200SizeAt200x200.png</file>
+ <file>drawLine_rop_bitmap/dst.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_AndNotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_AndROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_ClearROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_CopyROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NandROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NopROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NorROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotAndROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotCopyROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotOrROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_NotXorROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_OrNotROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_OrROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_SetROP.xbm</file>
+ <file>drawLine_rop_bitmap/res/res_XorROP.xbm</file>
+ <file>drawPixmap_rop/dst1.png</file>
+ <file>drawPixmap_rop/dst2.png</file>
+ <file>drawPixmap_rop/dst3.png</file>
+ <file>drawPixmap_rop/src1.xbm</file>
+ <file>drawPixmap_rop/src2-mask.xbm</file>
+ <file>drawPixmap_rop/src2.xbm</file>
+ <file>drawPixmap_rop/src3.xbm</file>
+ <file>drawPixmap_rop/res/res_AndNotROP0.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP1.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP2.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP3.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP4.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP5.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP6.png</file>
+ <file>drawPixmap_rop/res/res_AndNotROP7.png</file>
+ <file>drawPixmap_rop/res/res_AndROP0.png</file>
+ <file>drawPixmap_rop/res/res_AndROP1.png</file>
+ <file>drawPixmap_rop/res/res_AndROP2.png</file>
+ <file>drawPixmap_rop/res/res_AndROP3.png</file>
+ <file>drawPixmap_rop/res/res_AndROP4.png</file>
+ <file>drawPixmap_rop/res/res_AndROP5.png</file>
+ <file>drawPixmap_rop/res/res_AndROP6.png</file>
+ <file>drawPixmap_rop/res/res_AndROP7.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP0.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP1.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP2.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP3.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP4.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP5.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP6.png</file>
+ <file>drawPixmap_rop/res/res_ClearROP7.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP0.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP1.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP2.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP3.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP4.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP5.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP6.png</file>
+ <file>drawPixmap_rop/res/res_CopyROP7.png</file>
+ <file>drawPixmap_rop/res/res_NandROP0.png</file>
+ <file>drawPixmap_rop/res/res_NandROP1.png</file>
+ <file>drawPixmap_rop/res/res_NandROP2.png</file>
+ <file>drawPixmap_rop/res/res_NandROP3.png</file>
+ <file>drawPixmap_rop/res/res_NandROP4.png</file>
+ <file>drawPixmap_rop/res/res_NandROP5.png</file>
+ <file>drawPixmap_rop/res/res_NandROP6.png</file>
+ <file>drawPixmap_rop/res/res_NandROP7.png</file>
+ <file>drawPixmap_rop/res/res_NopROP0.png</file>
+ <file>drawPixmap_rop/res/res_NopROP1.png</file>
+ <file>drawPixmap_rop/res/res_NopROP2.png</file>
+ <file>drawPixmap_rop/res/res_NopROP3.png</file>
+ <file>drawPixmap_rop/res/res_NopROP4.png</file>
+ <file>drawPixmap_rop/res/res_NopROP5.png</file>
+ <file>drawPixmap_rop/res/res_NopROP6.png</file>
+ <file>drawPixmap_rop/res/res_NopROP7.png</file>
+ <file>drawPixmap_rop/res/res_NorROP0.png</file>
+ <file>drawPixmap_rop/res/res_NorROP1.png</file>
+ <file>drawPixmap_rop/res/res_NorROP2.png</file>
+ <file>drawPixmap_rop/res/res_NorROP3.png</file>
+ <file>drawPixmap_rop/res/res_NorROP4.png</file>
+ <file>drawPixmap_rop/res/res_NorROP5.png</file>
+ <file>drawPixmap_rop/res/res_NorROP6.png</file>
+ <file>drawPixmap_rop/res/res_NorROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotAndROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotCopyROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotOrROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotROP7.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP0.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP1.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP2.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP3.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP4.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP5.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP6.png</file>
+ <file>drawPixmap_rop/res/res_NotXorROP7.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP0.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP1.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP2.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP3.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP4.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP5.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP6.png</file>
+ <file>drawPixmap_rop/res/res_OrNotROP7.png</file>
+ <file>drawPixmap_rop/res/res_OrROP0.png</file>
+ <file>drawPixmap_rop/res/res_OrROP1.png</file>
+ <file>drawPixmap_rop/res/res_OrROP2.png</file>
+ <file>drawPixmap_rop/res/res_OrROP3.png</file>
+ <file>drawPixmap_rop/res/res_OrROP4.png</file>
+ <file>drawPixmap_rop/res/res_OrROP5.png</file>
+ <file>drawPixmap_rop/res/res_OrROP6.png</file>
+ <file>drawPixmap_rop/res/res_OrROP7.png</file>
+ <file>drawPixmap_rop/res/res_SetROP0.png</file>
+ <file>drawPixmap_rop/res/res_SetROP1.png</file>
+ <file>drawPixmap_rop/res/res_SetROP2.png</file>
+ <file>drawPixmap_rop/res/res_SetROP3.png</file>
+ <file>drawPixmap_rop/res/res_SetROP4.png</file>
+ <file>drawPixmap_rop/res/res_SetROP5.png</file>
+ <file>drawPixmap_rop/res/res_SetROP6.png</file>
+ <file>drawPixmap_rop/res/res_SetROP7.png</file>
+ <file>drawPixmap_rop/res/res_XorROP0.png</file>
+ <file>drawPixmap_rop/res/res_XorROP1.png</file>
+ <file>drawPixmap_rop/res/res_XorROP2.png</file>
+ <file>drawPixmap_rop/res/res_XorROP3.png</file>
+ <file>drawPixmap_rop/res/res_XorROP4.png</file>
+ <file>drawPixmap_rop/res/res_XorROP5.png</file>
+ <file>drawPixmap_rop/res/res_XorROP6.png</file>
+ <file>drawPixmap_rop/res/res_XorROP7.png</file>
+ <file>drawPixmap_rop_bitmap/dst.xbm</file>
+ <file>drawPixmap_rop_bitmap/src1-mask.xbm</file>
+ <file>drawPixmap_rop_bitmap/src1.xbm</file>
+ <file>drawPixmap_rop_bitmap/src2.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_AndNotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_AndROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_ClearROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_CopyROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NandROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NopROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NorROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotAndROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotCopyROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotOrROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_NotXorROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_OrNotROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_OrROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_SetROP.xbm</file>
+ <file>drawPixmap_rop_bitmap/res/res_XorROP.xbm</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 5072aa96c3..e23f7d41c5 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -289,7 +289,7 @@ private slots:
void blendARGBonRGB();
void RasterOp_NotDestination();
-
+ void drawTextNoHinting();
private:
void fillData();
void setPenColor(QPainter& p);
@@ -730,6 +730,7 @@ void tst_QPainter::initFrom()
pal.setColor(QPalette::Foreground, QColor(255, 0, 0));
pal.setBrush(QPalette::Background, QColor(0, 255, 0));
widget->setPalette(pal);
+ widget->show();
QFont font = widget->font();
font.setPointSize(26);
@@ -4813,6 +4814,21 @@ void tst_QPainter::RasterOp_NotDestination()
QCOMPARE(pixel, 0xff00ffff);
}
+void tst_QPainter::drawTextNoHinting()
+{
+ {
+ QImage image(250, 250, QImage::Format_RGB32);
+ QPainter p(&image);
+ QFont font("Arial", 8);
+ font.setHintingPreference(QFont::PreferNoHinting);
+ font.setStyleStrategy(QFont::PreferAntialias);
+ p.setFont(font);
+ p.drawText(image.rect(), "ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz");
+ }
+ // Testing for a crash when DirectWrite is used on Windows
+ QVERIFY(true);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"