summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-06 14:59:28 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-06 14:59:28 (GMT)
commit0d28f0098791d922c4ca8a68cbaec48b9be41eed (patch)
treeea2961fa530c400f39d508039bf22418b439cfe5
parente94d8fa7d327e1d48d9a1d409247845787f673a4 (diff)
Draw zoom level and popularity in debug mode. Both are sort key.
-rw-r--r--src/lib/marble/layers/PlacemarkLayer.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/marble/layers/PlacemarkLayer.cpp b/src/lib/marble/layers/PlacemarkLayer.cpp
index cd6ea40..9492d53 100644
--- a/src/lib/marble/layers/PlacemarkLayer.cpp
+++ b/src/lib/marble/layers/PlacemarkLayer.cpp
@@ -233,8 +233,17 @@ void PlacemarkLayer::renderDebug(GeoPainter *painter, ViewportParams *viewport,
for (auto placemark: placemarks) {
painter->drawRect(placemark->labelRect());
painter->drawRect(placemark->symbolRect());
- QString const popularity = QString::number(placemark->placemark()->popularity());
- painter->drawText(placemark->symbolRect().bottomLeft(), popularity);
+ }
+
+ auto const height = painter->fontMetrics().height();
+ painter->setPen(QPen(QColor(Qt::black)));
+ for (auto placemark: placemarks) {
+ QPoint position = placemark->symbolRect().bottomLeft().toPoint() + QPoint(0, qRound(0.8 * height));
+ auto const popularity = placemark->placemark()->popularity();
+ painter->drawText(position, QStringLiteral("p: %1").arg(popularity));
+ position -= QPoint(0, placemark->symbolRect().height() + height);
+ auto const zoomLevel = placemark->placemark()->zoomLevel();
+ painter->drawText(position, QStringLiteral("z: %1").arg(zoomLevel));
}
painter->restore();