QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
qgstemporalcontrollerwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstemporalcontrollerwidget.h
3 ---------------
4 begin : February 2020
5 copyright : (C) 2020 by Samweli Mwakisambwe
6 email : samweli at kartoza 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 QGSTEMPORALCONTROLLERWIDGET_H
19#define QGSTEMPORALCONTROLLERWIDGET_H
20
21#include "ui_qgstemporalcontrollerwidgetbase.h"
22
23#include "qgis_gui.h"
24#include "qgsrange.h"
26
27class QgsMapLayer;
31class QgsInterval;
32
39class GUI_EXPORT QgsTemporalControllerWidget : public QgsPanelWidget, private Ui::QgsTemporalControllerWidgetBase
40{
41 Q_OBJECT
42 public:
43
47 QgsTemporalControllerWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
48
54 QgsTemporalNavigationObject *temporalController();
55
56 bool applySizeConstraintsToStack() const override;
57
58#ifndef SIP_RUN
59
60 signals:
61
66
67#endif
68
69 protected:
70
71 void keyPressEvent( QKeyEvent *e ) override;
72
73 private:
74
76 QgsTemporalNavigationObject *mNavigationObject = nullptr;
77
78 int mBlockSettingUpdates = 0;
79 int mBlockFrameDurationUpdates = 0;
80
81 bool mHasTemporalLayersLoaded = false;
82
83 std::unique_ptr< QMenu > mRangeMenu;
84 QAction *mRangeSetToProjectAction = nullptr;
85 QAction *mRangeSetToAllLayersAction = nullptr;
86
87 std::unique_ptr< QMenu > mRangeLayersSubMenu;
88 QgsMapLayerModel *mMapLayerModel = nullptr;
89
90 void firstTemporalLayerLoaded( QgsMapLayer *layer );
91 void setTimeStep( const QgsInterval &timeStep );
92
108 void updateTimeStepInputs( const QgsInterval &timeStep );
109
110 private slots:
111
116 void timeSlider_valueChanged( int value );
117
121 void settings_clicked();
122
126 void setDates( const QgsDateTimeRange &range );
127
131 void setDatesToAllLayers();
132
138 void setDatesToProjectTime( bool tryLastStoredRange );
139
143 void updateSlider( const QgsDateTimeRange &range );
144
145 void totalMovieFramesChanged( long long frames );
146
150 void updateRangeLabel( const QgsDateTimeRange &range );
151
155 void updateTemporalExtent();
156
160 void updateFrameDuration();
161
162 void setWidgetStateFromProject();
163
164 void mNavigationOff_clicked();
165 void mNavigationFixedRange_clicked();
166 void mNavigationAnimated_clicked();
167 void mNavigationMovie_clicked();
168 void setWidgetStateFromNavigationMode( Qgis::TemporalNavigationMode mode );
169
170 void onLayersAdded( const QList<QgsMapLayer *> &layers );
171 void onProjectCleared();
172
173 void startEndDateTime_changed();
174 void fixedRangeStartEndDateTime_changed();
175
176 void saveRangeToProject();
177
178 void aboutToShowRangeMenu();
179
180 void mRangeSetToProjectAction_triggered();
181 void mRangeSetToAllLayersAction_triggered();
182};
183
184#endif // QGSTEMPORALCONTROLLERWIDGET_H
TemporalNavigationMode
Temporal navigation modes.
Definition qgis.h:2150
A representation of the interval between two datetime values.
Definition qgsinterval.h:46
The QgsMapLayerModel class is a model to display layers in widgets.
Base class for all map layer types.
Definition qgsmaplayer.h:75
Base class for any widget that can be shown as a inline panel.
virtual bool applySizeConstraintsToStack() const
Returns true if the size constraints and hints for the panel widget should be applied to the parent Q...
void keyPressEvent(QKeyEvent *event) override
Overridden key press event to handle the esc event on the widget.
A widget for controlling playback properties of a QgsTemporalController.
void exportAnimation()
Triggered when an animation should be exported.
A controller base class for temporal objects, contains a signal for notifying updates of the objects ...
Implements a temporal controller based on a frame by frame navigation and animation.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53