swift
aircraftcategorytreemodel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 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_MODELS_AIRCRAFTCATEGORYTREEMODEL_H
7 #define SWIFT_GUI_MODELS_AIRCRAFTCATEGORYTREEMODEL_H
8 
9 #include <QStandardItemModel>
10 
11 #include "gui/models/columns.h"
12 #include "gui/swiftguiexport.h"
14 
15 namespace swift::gui::models
16 {
18  class SWIFT_GUI_EXPORT CAircraftCategoryTreeModel : public QStandardItemModel
19  {
20  Q_OBJECT
21 
22  public:
24  explicit CAircraftCategoryTreeModel(QObject *parent = nullptr);
25 
27  virtual ~CAircraftCategoryTreeModel() override {}
28 
30  void setColumns(const CColumns &columns) { m_columns.setColumns(columns); }
31 
33  void updateContainer(const swift::misc::aviation::CAircraftCategoryList &categories);
34 
37  void clear();
38 
40  const swift::misc::aviation::CAircraftCategoryList &container() const { return m_categories; }
41 
42  private:
43  CColumns m_columns { "CAircraftCategoryTreeModel" };
45  };
46 } // namespace swift::gui::models
47 
48 #endif // SWIFT_GUI_MODELS_AIRCRAFTCATEGORYTREEMODEL_H
const swift::misc::aviation::CAircraftCategoryList & container() const
Get container.
void setColumns(const CColumns &columns)
Set columns.
Header data for a table.
Definition: columns.h:160
Value object encapsulating a list of ICAO codes.
Models to be used with views, mainly QTableView.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.