Marble

MarbleNavigator.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2005-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5//
6
7//
8// This widget is a control box for the Marble widget.
9//
10
11#ifndef MARBLE_MARBLENAVIGATOR_H
12#define MARBLE_MARBLENAVIGATOR_H
13
14#include <QWidget>
15
16#include "marble_export.h"
17
18/** @file
19 * This file contains the header for MarbleNavigator
20 *
21 * @author Torsten Rahn <tackat@kde.org>
22 * @author Inge Wallin <inge@lysator.liu.se>
23 */
24
25namespace Marble
26{
27
28class MarbleNavigatorPrivate;
29
30/**
31 * @short A widget class that contains simple controls for a
32 * MarbleWidget.
33 *
34 * This widget lets the user control an instance of MarbleWidget. The
35 * user can control panning and zooming as well as returning to a
36 * predefined view called the 'Home' position. You cannot change the
37 * Home position from the MarbleNavigator, though.
38 *
39 * @see MarbleWidget
40 */
41
42class MARBLE_EXPORT MarbleNavigator : public QWidget
43{
44 Q_OBJECT
45
46public:
47 /**
48 * @brief Construct a new MarbleNavigator
49 * @param parent the parent widget
50 */
51 explicit MarbleNavigator(QWidget *parent = nullptr);
52 ~MarbleNavigator() override;
53
54 /**
55 * @brief Return the minimum zoom level set in the widget.
56 * @return the minimum zoom level set in the widget.
57 */
58 int minimumZoom() const;
59
60Q_SIGNALS:
61 /**
62 * @brief Signal emitted when the Home button has been pressed.
63 */
64 void goHome();
65 /**
66 * @brief Signal emitted when the Zoom In button has been pressed.
67 */
68 void zoomIn();
69 /**
70 * @brief Signal emitted when the Zoom Out button has been pressed.
71 */
72 void zoomOut();
73 /**
74 * @brief Signal emitted when the zoom slider has been moved.
75 * @param zoom The new zoom value.
76 */
77 void zoomChanged(int zoom);
78
79 /**
80 * @brief Signal emitted when the Move Left button has been pressed.
81 */
82 void moveLeft();
83 /**
84 * @brief Signal emitted when the Move Right button has been pressed.
85 */
86 void moveRight();
87 /**
88 * @brief Signal emitted when the Move Up button has been pressed.
89 */
90 void moveUp();
91 /**
92 * @brief Signal emitted when the Move Down button has been pressed.
93 */
94 void moveDown();
95 // void centerOn(const QModelIndex&);
96
97public Q_SLOTS:
98 /**
99 * @brief Sets the value of the slider.
100 * @param zoom The new zoom value.
101 *
102 * This slot should be called when the zoom value is changed from
103 * the widget itself, e.g. by using the scroll wheel. It sets the
104 * value of the slider, but nothing more. In particular it
105 * doesn't emit the zoomChanged signal.
106 */
107 void changeZoom(int zoom);
108
109protected:
110 /**
111 * @brief Reimplementation of the resizeEvent() of the widget.
112 *
113 * If the MarbleNavigator gets shrunk enough, the slider will be
114 * hidden, leaving only the Zoom Up and Zoom Down buttons.
115 */
116 void resizeEvent(QResizeEvent *) override;
117
118private:
119 Q_DISABLE_COPY(MarbleNavigator)
120 MarbleNavigatorPrivate *const d;
121};
122
123}
124
125#endif
A widget class that contains simple controls for a MarbleWidget.
void zoomChanged(int zoom)
Signal emitted when the zoom slider has been moved.
void moveRight()
Signal emitted when the Move Right button has been pressed.
void zoomIn()
Signal emitted when the Zoom In button has been pressed.
void moveDown()
Signal emitted when the Move Down button has been pressed.
void moveLeft()
Signal emitted when the Move Left button has been pressed.
void zoomOut()
Signal emitted when the Zoom Out button has been pressed.
void goHome()
Signal emitted when the Home button has been pressed.
void moveUp()
Signal emitted when the Move Up button has been pressed.
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 Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.