QGIS API Documentation 3.39.0-Master (47f7b3a4989)
Loading...
Searching...
No Matches
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 void setInverted( bool inverted );
47 void setSignificantElevations( const QList< double > &elevations );
48
49 private:
50
51 QgsDoubleRange mLimits;
52 QgsDoubleRange mRange;
53 bool mInverted = false;
54 QList< double > mSignificantElevations;
55
56};
57
58class GUI_EXPORT QgsElevationControllerSettingsAction: public QWidgetAction
59{
60 Q_OBJECT
61
62 public:
63
64 QgsElevationControllerSettingsAction( QWidget *parent = nullptr );
65
66 QgsDoubleSpinBox *sizeSpin();
67
68 private:
69
70 QgsDoubleSpinBox *mSizeSpin = nullptr;
71};
72
73
75
82class GUI_EXPORT QgsElevationControllerWidget : public QWidget
83{
84
85#ifdef SIP_RUN
87 if ( qobject_cast<QgsElevationControllerWidget *>( sipCpp ) != nullptr )
88 sipType = sipType_QgsElevationControllerWidget;
89 else
90 sipType = nullptr;
92#endif
93
94 Q_OBJECT
95
96 public:
97
101 QgsElevationControllerWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
102
103 void resizeEvent( QResizeEvent *event ) override;
104
111 QgsDoubleRange range() const;
112
118 QgsDoubleRange rangeLimits() const;
119
123 QgsRangeSlider *slider();
124
129 QMenu *menu();
130
139 double fixedRangeSize() const;
140
141 public slots:
142
149 void setRange( const QgsDoubleRange &range );
150
156 void setRangeLimits( const QgsDoubleRange &limits );
157
167 void setFixedRangeSize( double size );
168
174 void setInverted( bool inverted );
175
179 void setSignificantElevations( const QList< double > &elevations );
180
181 signals:
182
189 void rangeChanged( const QgsDoubleRange &range );
190
197 void fixedRangeSizeChanged( double size );
198
204 void invertedChanged( bool inverted );
205
206 private:
207
208 void updateWidgetMask();
209
210 QToolButton *mConfigureButton = nullptr;
211 QgsElevationControllerSettingsAction *mSettingsAction = nullptr;
212 QMenu *mMenu = nullptr;
213 QAction *mInvertDirectionAction = nullptr;
214 QgsRangeSlider *mSlider = nullptr;
215 QgsElevationControllerLabels *mSliderLabels = nullptr;
216 QgsDoubleRange mRangeLimits;
217 QgsDoubleRange mCurrentRange;
218 double mFixedRangeSize = -1;
219 int mBlockSliderChanges = 0;
220 double mSliderPrecision = 100;
221
222};
223
224#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 invertedChanged(bool inverted)
Emitted when the elevation filter slider is inverted.
void fixedRangeSizeChanged(double size)
Emitted when the fixed range size is changed from the widget.
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_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_END
Definition qgis_sip.h:208