summaryrefslogtreecommitdiffstats
path: root/tests/test-painter.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-16 15:32:39 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-16 15:32:39 -0500
commit7d1ad9f6f50c3ba3829b14c0eb9a52836b8d7d5d (patch)
tree784d3ea1add0f296cfeeaf1e04b692a9b1f689cb /tests/test-painter.cpp
parent2e57d2cf81ee9f642a59bd20712f80fa9b13ee08 (diff)
downloadgtk3-tqt-engine-7d1ad9f6f50c3ba3829b14c0eb9a52836b8d7d5d.tar.gz
gtk3-tqt-engine-7d1ad9f6f50c3ba3829b14c0eb9a52836b8d7d5d.zip
Add more primitives to Cairo drawing backend
Diffstat (limited to 'tests/test-painter.cpp')
-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 */