swift
aircraftcategorytreeview.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_VIEWS_AIRCRAFTCATEGORYTREEVIEW_H
7 #define SWIFT_GUI_VIEWS_AIRCRAFTCATEGORYTREEVIEW_H
8 
9 #include <QMap>
10 #include <QModelIndex>
11 #include <QObject>
12 #include <QPoint>
13 #include <QTreeView>
14 
15 #include "gui/swiftguiexport.h"
17 #include "misc/digestsignal.h"
18 
19 namespace swift::gui
20 {
21  namespace models
22  {
23  class CAircraftCategoryTreeModel;
24  class CColumns;
25  } // namespace models
26 
27  namespace views
28  {
31  {
32  Q_OBJECT
33 
34  public:
36  explicit CAircraftCategoryTreeView(QWidget *parent = nullptr);
37 
39  void updateContainer(const swift::misc::aviation::CAircraftCategoryList &categories);
40 
42  void clear();
43 
45  void fullResizeToContents();
46 
48  void setColumns(const models::CColumns &columns);
49 
51  bool isEmpty() const;
52 
53  private:
55  const models::CAircraftCategoryTreeModel *categoryModel() const;
56 
59 
61  void fullResizeToContentsImpl();
62 
64  swift::misc::aviation::CAircraftCategory selectedObject() const;
65 
67  void onExpanded(const QModelIndex &index);
68 
70  void customMenu(const QPoint &point);
71 
72  misc::CDigestSignal m_dsFullResize { this, &CAircraftCategoryTreeView::fullResizeToContentsImpl,
73  std::chrono::milliseconds(1000), 25 };
74  };
75  } // namespace views
76 } // namespace swift::gui
77 
78 #endif // SWIFT_GUI_VIEWS_AIRCRAFTCATEGORYTREEVIEW_H
Header data for a table.
Definition: columns.h:160
Receive 1..n signals, collect them over time, and resend afer n milliseconds.
Definition: digestsignal.h:18
Value object for aircraft categories.
Value object encapsulating a list of ICAO codes.
GUI related classes.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.