QGIS API Documentation 3.41.0-Master (af5edcb665c)
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:
46 QgsTemporalControllerWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
47
53 QgsTemporalNavigationObject *temporalController();
54
55 bool applySizeConstraintsToStack() const override;
56
57#ifndef SIP_RUN
58
59 signals:
60
65
66#endif
67
68 protected:
69 void keyPressEvent( QKeyEvent *e ) override;
70
71 private:
73 QgsTemporalNavigationObject *mNavigationObject = nullptr;
74
75 int mBlockSettingUpdates = 0;
76 int mBlockFrameDurationUpdates = 0;
77
78 bool mHasTemporalLayersLoaded = false;
79
80 std::unique_ptr<QMenu> mRangeMenu;
81 QAction *mRangeSetToProjectAction = nullptr;
82 QAction *mRangeSetToAllLayersAction = nullptr;
83
84 std::unique_ptr<QMenu> mRangeLayersSubMenu;
85 QgsMapLayerModel *mMapLayerModel = nullptr;
86
87 void firstTemporalLayerLoaded( QgsMapLayer *layer );
88 void setTimeStep( const QgsInterval &timeStep );
89
105 void updateTimeStepInputs( const QgsInterval &timeStep );
106
107 private slots:
108
113 void timeSlider_valueChanged( int value );
114
118 void settings_clicked();
119
123 void setDates( const QgsDateTimeRange &range );
124
128 void setDatesToAllLayers();
129
135 void setDatesToProjectTime( bool tryLastStoredRange );
136
140 void updateSlider( const QgsDateTimeRange &range );
141
142 void totalMovieFramesChanged( long long frames );
143
147 void updateRangeLabel( const QgsDateTimeRange &range );
148
152 void updateTemporalExtent();
153
157 void updateFrameDuration();
158
159 void setWidgetStateFromProject();
160
161 void mNavigationOff_clicked();
162 void mNavigationFixedRange_clicked();
163 void mNavigationAnimated_clicked();
164 void mNavigationMovie_clicked();
165 void setWidgetStateFromNavigationMode( Qgis::TemporalNavigationMode mode );
166
167 void onLayersAdded( const QList<QgsMapLayer *> &layers );
168 void onProjectCleared();
169
170 void startEndDateTime_changed();
171 void fixedRangeStartEndDateTime_changed();
172
173 void saveRangeToProject();
174
175 void aboutToShowRangeMenu();
176
177 void mRangeSetToProjectAction_triggered();
178 void mRangeSetToAllLayersAction_triggered();
179};
180
181#endif // QGSTEMPORALCONTROLLERWIDGET_H
TemporalNavigationMode
Temporal navigation modes.
Definition qgis.h:2429
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:76
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