Ref T472, category model/view + tree view

This commit is contained in:
Klaus Basan
2019-02-03 21:37:30 +01:00
committed by Mat Sutcliffe
parent b85222e1f5
commit 969600b65d
14 changed files with 500 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
/* Copyright (C) 2019
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKGUI_MODELS_AIRCRAFTCATEGORYTREEMODEL_H
#define BLACKGUI_MODELS_AIRCRAFTCATEGORYTREEMODEL_H
#include "columns.h"
#include "blackmisc/aviation/aircraftcategorylist.h"
#include "blackgui/blackguiexport.h"
#include <QStandardItemModel>
namespace BlackGui
{
namespace Models
{
//! ATC list model
class BLACKGUI_EXPORT CAircraftCategoryTreeModel : public QStandardItemModel
{
Q_OBJECT
public:
//! Constructor
explicit CAircraftCategoryTreeModel(QObject *parent = nullptr);
//! Destructor
virtual ~CAircraftCategoryTreeModel() override {}
//! Set columns
void setColumns(const CColumns &columns) { m_columns.setColumns(columns); }
//! Update container
void updateContainer(const BlackMisc::Aviation::CAircraftCategoryList &categories);
//! Clear everything
//! \remark hiding QStandardItemModel::clear()
void clear();
//! Get container
const BlackMisc::Aviation::CAircraftCategoryList &container() const { return m_categories; }
private:
CColumns m_columns { "CAircraftCategoryTreeModel" };
BlackMisc::Aviation::CAircraftCategoryList m_categories;
};
} // ns
} // ns
#endif // guard