QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgselevationcontrollerwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgselevationcontrollerwidget.h
3 ---------------
4 begin : March 2024
5 copyright : (C) 2024 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSELEVATIONCONTROLLERWIDGET_H
19#define QGSELEVATIONCONTROLLERWIDGET_H
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23#include "qgsrange.h"
24#include <QWidget>
25#include <QWidgetAction>
26
27class QgsRangeSlider;
29class QToolButton;
30class QMenu;
31
33
34class GUI_EXPORT QgsElevationControllerLabels : public QWidget SIP_SKIP
35{
36 Q_OBJECT
37
38 public:
39
40 QgsElevationControllerLabels( QWidget *parent SIP_TRANSFERTHIS = nullptr );
41
42 void paintEvent( QPaintEvent *event ) override;
43
44 void setLimits( const QgsDoubleRange &limits );
45 void setRange( const QgsDoubleRange &range );
46
47 private:
48
49 QgsDoubleRange mLimits;
50 QgsDoubleRange mRange;
51
52};
53
54class GUI_EXPORT QgsElevationControllerSettingsAction: public QWidgetAction
55{
56 Q_OBJECT
57
58 public:
59
60 QgsElevationControllerSettingsAction( QWidget *parent = nullptr );
61
62 QgsDoubleSpinBox *sizeSpin();
63
64 private:
65
66 QgsDoubleSpinBox *mSizeSpin = nullptr;
67};
68
69
71
78class GUI_EXPORT QgsElevationControllerWidget : public QWidget
79{
80
81 Q_OBJECT
82
83 public:
84
88 QgsElevationControllerWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
89
90 void resizeEvent( QResizeEvent *event ) override;
91
98 QgsDoubleRange range() const;
99
105 QgsDoubleRange rangeLimits() const;
106
110 QgsRangeSlider *slider();
111
116 QMenu *menu();
117
126 double fixedRangeSize() const;
127
128 public slots:
129
136 void setRange( const QgsDoubleRange &range );
137
143 void setRangeLimits( const QgsDoubleRange &limits );
144
153 void setFixedRangeSize( double size );
154
155 signals:
156
163 void rangeChanged( const QgsDoubleRange &range );
164
165 private:
166
167 void updateWidgetMask();
168
169 QToolButton *mConfigureButton = nullptr;
170 QMenu *mMenu = nullptr;
171 QgsRangeSlider *mSlider = nullptr;
172 QgsElevationControllerLabels *mSliderLabels = nullptr;
173 QgsDoubleRange mRangeLimits;
174 QgsDoubleRange mCurrentRange;
175 double mFixedRangeSize = -1;
176 int mBlockSliderChanges = 0;
177 double mSliderPrecision = 100;
178
179};
180
181#endif // QGSELEVATIONCONTROLLERWIDGET_H
QgsRange which stores a range of double values.
Definition: qgsrange.h:231
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
A widget for configuring vertical elevation slicing behavior for maps.
void rangeChanged(const QgsDoubleRange &range)
Emitted when the visible range from the widget is changed.
A slider control with two interactive endpoints, for interactive selection of a range of values.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_SKIP
Definition: qgis_sip.h:126