8import QtQuick.Controls as QQC2
14 implicitHeight: background.height
15 visible: !map.mapLoader.isLoading && !map.hasError
17 property int __margin: 2
19 function updateScale() {
20 var d = map.view.mapScreenToMeters(background.width - 2 * __margin);
21 var s = d < 5 ? 1 : d < 20 ? 5 : d < 100 ? 10 : 20;
25 scaleLabel.text =
i18ndc(
"kosmindoormap",
"length in meters",
"%1 m", d)
26 scale.width =
map.view.mapMetersToScreen(d);
31 color: scaleLabel.palette.base
33 height: scaleLabel.implicitHeight + scale.height + 2 * root.__margin
39 anchors.bottom: scale.top
40 anchors.horizontalCenter: scale.horizontalCenter
45 anchors.bottom: root.bottom
46 anchors.left: root.left
47 anchors.margins: root.__margin
49 color: scaleLabel.color
52 Component.onCompleted: root.updateScale()
56 function onTransformationChanged() { root.updateScale(); }
60 function onWidthChanged() { root.updateScale(); }
QString i18ndc(const char *domain, const char *context, const char *text, const TYPE &arg...)
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:02:24 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.