summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-15 13:02:37 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-15 13:02:37 -0500
commit623f11f6000cb2f05f51c81e7a1c6fc02ce21907 (patch)
treeebff174e76c82e87e00f0f167073c2d435fef91a /tests
parent467876d56afdf133bdce18b7a1ed13a303e82703 (diff)
downloadgtk3-tqt-engine-623f11f6000cb2f05f51c81e7a1c6fc02ce21907.tar.gz
gtk3-tqt-engine-623f11f6000cb2f05f51c81e7a1c6fc02ce21907.zip
Fix pixel imperfection, image drawing, and clipping problems
Update test suite
Diffstat (limited to 'tests')
-rw-r--r--tests/test-painter.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/test-painter.cpp b/tests/test-painter.cpp
index 45e064c..3c21432 100644
--- a/tests/test-painter.cpp
+++ b/tests/test-painter.cpp
@@ -2,6 +2,7 @@
#include <tqpainter.h>
#include <tqapplication.h>
+#include <tqstyle.h>
#include "tqtcairopainter.h"
@@ -36,6 +37,14 @@ void drawColorWheel(TQPainter *p, double scale)
void runTests(TQPaintDevice* pd) {
TQPainter p(pd);
+ // Background
+ {
+ p.setPen( TQt::NoPen );
+ TQBrush brush(TQColor(0,0,0), TQBrush::SolidPattern);
+ p.setBrush(brush);
+ p.drawRect(0,0,1000,1000);
+ }
+
// Rectangle tests
{
p.setPen(TQPen(TQt::red, 1));
@@ -44,8 +53,9 @@ void runTests(TQPaintDevice* pd) {
p.setBrush( brush ); // set the yellow brush
p.setPen( TQt::NoPen ); // do not draw outline
p.drawRect( 0,0, 25,25 ); // draw filled rectangle
+ p.drawRect( 452,400, 25,25 ); // draw filled rectangle
TQBrush brush2( TQt::green, TQBrush::SolidPattern ); // green pattern
- p.setBrush( brush2 ); // set the yellow brush
+ p.setBrush( brush2 ); // set the green brush
p.setPen( TQt::NoPen ); // do not draw outline
p.drawRect( 40,30, 200,100 ); // draw filled rectangle
p.setBrush( TQt::NoBrush ); // do not fill
@@ -100,6 +110,9 @@ void runTests(TQPaintDevice* pd) {
p.setBrush(TQBrush());
p.setPen(TQPen(TQt::blue, 1));
p.drawRoundRect(80, 150, 50, 50);
+ p.setBrush(TQt::green);
+ p.setPen(TQPen());
+ p.drawRoundRect(150, 150, 50, 50);
}
// Ellipse tests
@@ -110,6 +123,9 @@ void runTests(TQPaintDevice* pd) {
p.setBrush(TQBrush());
p.setPen(TQPen(TQt::blue, 1));
p.drawEllipse(80, 220, 50, 50);
+ p.setBrush(TQt::green);
+ p.setPen(TQPen());
+ p.drawEllipse(150, 220, 50, 50);
}
// Arc tests
@@ -161,6 +177,7 @@ void runTests(TQPaintDevice* pd) {
p.drawCubicBezier(a);
}
+#if 1
// Pixmap tests
{
TQPixmap pixmap("open.png");
@@ -172,7 +189,9 @@ void runTests(TQPaintDevice* pd) {
TQImage image("open.png");
p.drawImage(350, 10, image, 0, 0, -1, -1);
}
+#endif
+#if 0
// Font tests
{
p.setPen(TQColor(0,128,255));
@@ -208,6 +227,7 @@ void runTests(TQPaintDevice* pd) {
//p.drawText( TQRect(0, 250, 250, 150), TQt::BreakAnywhere | TQt::AlignCenter, TQString("TQt3 renders via Cairo!") );
//p.drawText( TQRect(0, 250, 250, 150), TQt::BreakAnywhere | TQt::AlignHCenter | TQt::AlignBottom, TQString("TQt3 renders via Cairo!") );
}
+#endif
// Clipping tests
{
@@ -226,11 +246,17 @@ void runTests(TQPaintDevice* pd) {
p.setBrush(TQBrush(TQt::white));
p.setPen(TQPen());
p.drawRect(325, 275, 50, 50);
+ p.setRasterOp(TQPainter::CopyROP);
}
//drawColorWheel(&p, 0.5);
//drawColorWheel(&p, 1.0);
+ TQColorGroup cg;
+ cg.setColor(TQColorGroup::Background, TQColor(128,128,128));
+ cg.setColor(TQColorGroup::Foreground, TQColor(0,0,0));
+ tqApp->style().drawPrimitive(TQStyle::PE_ExclusiveIndicator, &p, TQRect(400, 400, 16, 16), cg, TQStyle::Style_Down);
+
p.end();
}