Navigator2Go  2.0
Manage your local Ocean Navigator installation.
widgetmonthpicker.h
1 #ifndef WIDGETMONTHPICKER_H
2 #define WIDGETMONTHPICKER_H
3 
4 #include "nodiscard.h"
5 
6 #include <QWidget>
7 #include <QDate>
8 
9 /***********************************************************************************/
10 // Forward declarations
11 namespace Ui {
12 class WidgetMonthPicker;
13 }
14 class QComboBox;
15 
16 /***********************************************************************************/
17 class WidgetMonthPicker : public QWidget {
18  Q_OBJECT
19 
20 public:
21  explicit WidgetMonthPicker(QWidget* parent = nullptr);
22  ~WidgetMonthPicker() override;
23 
24  void setStartEndDate(const QDate& start, const QDate& end);
25 
26  NODISCARD std::pair<QDate, QDate> getStartEndDate() const;
27 
28 private slots:
29  void on_comboBoxStartMonth_currentIndexChanged(int index);
30  void on_comboBoxEndMonth_currentIndexChanged(int index);
31  void on_comboBoxStartYear_currentIndexChanged(const QString& arg1);
32  void on_comboBoxEndYear_currentIndexChanged(const QString& arg1);
33 
34 private:
35  //
36  void populateMonth(const int year, QComboBox* comboBox);
37  //
38  void validateMonthSelection();
39 
40  Ui::WidgetMonthPicker* m_ui{nullptr};
41  QDate m_startDate, m_endDate;
42  bool m_showErrorDialog{false};
43 };
44 
45 #endif // WIDGETMONTHPICKER_H
Definition: dialogdatasetview.h:16
Definition: widgetmonthpicker.h:17