Marble

LatLonEdit.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Henry de Valence <hdevalence@gmail.com>
4// SPDX-FileCopyrightText: 2011 Friedrich W. H. Kossebau <kossebau@kde.org>
5
6#ifndef MARBLE_LATLONEDIT_H
7#define MARBLE_LATLONEDIT_H
8
9#include <QWidget>
10
11#include "GeoDataCoordinates.h"
12#include "MarbleGlobal.h"
13#include "marble_export.h"
14
15namespace Marble
16{
17
18class LatLonEditPrivate;
19
20class MARBLE_EXPORT LatLonEdit : public QWidget
21{
22 Q_OBJECT
23 // FIXME: make the dimension enum work
24 // Q_PROPERTY( qreal value READ value WRITE setValue )
25 // Q_PROPERTY( int dimension READ dimension WRITE setDimension )
26
27public:
28 /**
29 * @brief This enum is used to choose the dimension.
30 */
31 enum Dimension {
32 Latitude, ///< Latitude
33 Longitude ///< Longitude
34 };
35
36 explicit LatLonEdit(QWidget *parent = nullptr, Dimension dimension = Longitude, GeoDataCoordinates::Notation notation = GeoDataCoordinates::DMS);
37 ~LatLonEdit() override;
38 qreal value() const;
39 Dimension dimension() const;
40 GeoDataCoordinates::Notation notation() const;
41public Q_SLOTS:
42 void setValue(qreal newvalue);
43 void setDimension(Dimension dimension);
44 void setNotation(GeoDataCoordinates::Notation notation);
45Q_SIGNALS:
46 void valueChanged(qreal value);
47private Q_SLOTS:
48 void checkIntValueOverflow();
49 void checkUIntValueOverflow();
50 void checkFloatValueOverflow();
51 void onSignChanged();
52
53private:
54 // recalculates m_value based on spinboxes
55 void recalculate();
56
57private:
58 LatLonEditPrivate *const d;
59};
60
61}
62
63#endif
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.