summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-painter.cpp61
1 files changed, 60 insertions, 1 deletions
diff --git a/tests/test-painter.cpp b/tests/test-painter.cpp
index 8a2b02e..f932c83 100644
--- a/tests/test-painter.cpp
+++ b/tests/test-painter.cpp
@@ -65,7 +65,7 @@ main (int argc, char *argv[])
// Polyline tests
{
TQPointArray a;
- int x1 = 200;
+ int x1 = 250;
int y1 = 10;
a.setPoints( 11, x1+0, y1+85, x1+75, y1+75, x1+100, y1+10, x1+125, y1+75, x1+200, y1+85, x1+150, y1+125, x1+160, y1+190, x1+100, y1+150, x1+40, y1+190, x1+50, y1+125, x1+0, y1+85 );
@@ -73,6 +73,65 @@ main (int argc, char *argv[])
p.drawPolyline(a);
}
+ // Polyfill tests
+ {
+ TQPointArray a;
+ int x1 = 250;
+ int y1 = 200;
+
+ a.setPoints( 11, x1+0, y1+85, x1+75, y1+75, x1+100, y1+10, x1+125, y1+75, x1+200, y1+85, x1+150, y1+125, x1+160, y1+190, x1+100, y1+150, x1+40, y1+190, x1+50, y1+125, x1+0, y1+85 );
+ p.setPen(TQt::blue);
+ p.setBrush(TQt::green);
+ p.drawPolygon(a);
+ }
+
+ // Rounded rectangle tests
+ {
+ p.setBrush(TQt::green);
+ p.setPen(TQPen(TQt::red, 1));
+ p.drawRoundRect(10, 150, 50, 50);
+ p.setBrush(TQBrush());
+ p.setPen(TQPen(TQt::blue, 1));
+ p.drawRoundRect(80, 150, 50, 50);
+ }
+
+ // Ellipse tests
+ {
+ p.setBrush(TQt::green);
+ p.setPen(TQPen(TQt::red, 1));
+ p.drawEllipse(10, 220, 50, 50);
+ p.setBrush(TQBrush());
+ p.setPen(TQPen(TQt::blue, 1));
+ p.drawEllipse(80, 220, 50, 50);
+ }
+
+ // Arc tests
+ {
+ p.setBrush(TQBrush());
+ p.setPen(TQPen(TQt::yellow, 1));
+ p.drawArc(10,10, 70,100, 100*16, 160*16); // draws a "(" arc
+ }
+
+ // Pie tests
+ {
+ p.setBrush(TQBrush());
+ p.setPen(TQPen(TQt::red, 1));
+ p.drawPie(250, 400, 200, 100, 45*16, 90*16);
+ p.setBrush(TQt::green);
+ p.setPen(TQPen(TQt::blue, 1));
+ p.drawPie(250, 450, 200, 100, 45*16, 90*16);
+ }
+
+ // Chord tests
+ {
+ p.setBrush(TQBrush());
+ p.setPen(TQPen(TQt::red, 1));
+ p.drawChord(100, 400, 200, 100, 45*16, 90*16);
+ p.setBrush(TQt::green);
+ p.setPen(TQPen(TQt::blue, 1));
+ p.drawChord(100, 450, 200, 100, 45*16, 90*16);
+ }
+
p.end();
/* Write output and clean up */