diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/geotestplugin/qgeomappingmanagerengine_test.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/tests/auto/geotestplugin/qgeomappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeomappingmanagerengine_test.h index 7d4ebd10..37e57385 100644 --- a/tests/auto/geotestplugin/qgeomappingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeomappingmanagerengine_test.h @@ -45,6 +45,7 @@ #include <qgeoserviceprovider.h> #include <qgeomappingmanagerengine.h> #include <QLocale> +#include <QPainter> #include <QPixmap> #include <QByteArray> #include <QBuffer> @@ -108,19 +109,30 @@ public: QGeoTiledMapReply* getTileImage(const TileSpec &spec) { - //qDebug() << __FUNCTION__ << "in test plugin for spec: " << spec.x() << spec.y() << spec.zoom(); mappingReply_ = new TiledMapReplyTest(spec, this); QImage im(256, 256, QImage::Format_RGB888); - im.fill(0); - - for (int y = 0; y < im.height(); y++) { - for (int x = 0; x < im.width(); x++) { - im.setPixel(x, y, (x + y) % 255); - } - } + im.fill(QColor("lightgray")); + QRectF rect; + QString text("X: " + QString::number(spec.x()) + "\nY: " + QString::number(spec.y()) + "\nZ: " + QString::number(spec.zoom())); + rect.setWidth(250); + rect.setHeight(250); + rect.setLeft(3); + rect.setTop(3); + QPainter painter; + QPen pen(QColor("firebrick")); + painter.begin(&im); + painter.setPen(pen); + painter.setFont( QFont("Times", 35, 10, false)); + painter.drawText(rect, text); + // different border color for vertically and horizontally adjacent frames + if ((spec.x() + spec.y()) % 2 == 0) + pen.setColor(QColor("yellow")); + pen.setWidth(5); + painter.setPen(pen); + painter.drawRect(0,0,255,255); + painter.end(); QPixmap pm = QPixmap::fromImage(im); - QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); |