swift
atcstationtreemodel.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_MODELS_ATCTREEMODEL_H
7 #define SWIFT_GUI_MODELS_ATCTREEMODEL_H
8 
9 #include <QHash>
10 #include <QStandardItemModel>
11 
12 #include "gui/models/columns.h"
13 #include "gui/swiftguiexport.h"
15 
16 namespace swift::gui::models
17 {
19  class SWIFT_GUI_EXPORT CAtcStationTreeModel : public QStandardItemModel
20  {
21  Q_OBJECT
22 
23  public:
25  explicit CAtcStationTreeModel(QObject *parent = nullptr);
26 
28  virtual ~CAtcStationTreeModel() override {}
29 
31  void setColumns(const CColumns &columns) { m_columns.setColumns(columns); }
32 
34  void updateContainer(const swift::misc::aviation::CAtcStationList &stations);
35 
38  void clear();
39 
41  const swift::misc::aviation::CAtcStationList &container() const { return m_stations; }
42 
44  void changedAtcStationConnectionStatus(const swift::misc::aviation::CAtcStation &station, bool added);
45 
46  private:
47  CColumns m_columns { "CAtcStationTreeModel" };
50  QStringList m_suffixes;
51  };
52 } // namespace swift::gui::models
53 #endif // SWIFT_GUI_MODELS_ATCTREEMODEL_H
void setColumns(const CColumns &columns)
Set columns.
const swift::misc::aviation::CAtcStationList & container() const
Get container.
Header data for a table.
Definition: columns.h:160
Value object encapsulating information about an ATC station.
Definition: atcstation.h:38
Value object for a list of ATC stations.
Models to be used with views, mainly QTableView.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.