QGIS API Documentation 3.41.0-Master (57ec4277f5e)
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 QgsElevationControllerLabels( QWidget *parent SIP_TRANSFERTHIS = nullptr );
40
41 void paintEvent( QPaintEvent *event ) override;
42
43 void setLimits( const QgsDoubleRange &limits );
44 void setRange( const QgsDoubleRange &range );
45 void setInverted( bool inverted );
46 void setSignificantElevations( const QList<double> &elevations );
47
48 private:
49 QgsDoubleRange mLimits;
50 QgsDoubleRange mRange;
51 bool mInverted = false;
52 QList<double> mSignificantElevations;
53};
54
55class GUI_EXPORT QgsElevationControllerSettingsAction : public QWidgetAction
56{
57 Q_OBJECT
58
59 public:
60 QgsElevationControllerSettingsAction( QWidget *parent = nullptr );
61
62 QgsDoubleSpinBox *sizeSpin();
63
64 private:
65 QgsDoubleSpinBox *mSizeSpin = nullptr;
66};
67
68
70
77class GUI_EXPORT QgsElevationControllerWidget : public QWidget
78{
79#ifdef SIP_RUN
81 if ( qobject_cast<QgsElevationControllerWidget *>( sipCpp ) != nullptr )
82 sipType = sipType_QgsElevationControllerWidget;
83 else
84 sipType = nullptr;
86#endif
87
88 Q_OBJECT
89
90 public:
94 QgsElevationControllerWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
95
96 void resizeEvent( QResizeEvent *event ) override;
97
104 QgsDoubleRange range() const;
105
111 QgsDoubleRange rangeLimits() const;
112
116 QgsRangeSlider *slider();
117
122 QMenu *menu();
123
132 double fixedRangeSize() const;
133
134 public slots:
135
142 void setRange( const QgsDoubleRange &range );
143
149 void setRangeLimits( const QgsDoubleRange &limits );
150
160 void setFixedRangeSize( double size );
161
167 void setInverted( bool inverted );
168
172 void setSignificantElevations( const QList<double> &elevations );
173
174 signals:
175
182 void rangeChanged( const QgsDoubleRange &range );
183
190 void fixedRangeSizeChanged( double size );
191
197 void invertedChanged( bool inverted );
198
199 private:
200 void updateWidgetMask();
201
202 QToolButton *mConfigureButton = nullptr;
203 QgsElevationControllerSettingsAction *mSettingsAction = nullptr;
204 QMenu *mMenu = nullptr;
205 QAction *mInvertDirectionAction = nullptr;
206 QgsRangeSlider *mSlider = nullptr;
207 QgsElevationControllerLabels *mSliderLabels = nullptr;
208 QgsDoubleRange mRangeLimits;
209 QgsDoubleRange mCurrentRange;
210 double mFixedRangeSize = -1;
211 int mBlockSliderChanges = 0;
212 double mSliderPrecision = 100;
213};
214
215#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