mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 23:05:34 +08:00
refs #452 models and views created
* for new value objects (e.g. distributor, ...) * new modes are required (e.g. CStatusMessageListModel::Simplified) * model filter allowing to filter models
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f9048de1e6
commit
2c91b3ada0
49
src/blackgui/models/aircrafticaolistmodel.cpp
Normal file
49
src/blackgui/models/aircrafticaolistmodel.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
/* Copyright (C) 2015
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "aircrafticaolistmodel.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <QMetaProperty>
|
||||
#include <QBrush>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
CAircraftIcaoCodeListModel::CAircraftIcaoCodeListModel(QObject *parent) :
|
||||
CListModelBase<BlackMisc::Aviation::CAircraftIcaoCode, BlackMisc::Aviation::CAircraftIcaoCodeList>("AircraftIcaoListModel", parent)
|
||||
{
|
||||
this->m_columns.addColumn(CColumn::standardString("id", CAircraftIcaoCode::IndexDbIntegerKey, CDefaultFormatter::alignRightVCenter()));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("ICAO", CAircraftIcaoCode::IndexAircraftDesignator));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("rank", CAircraftIcaoCode::IndexRank, CDefaultFormatter::alignRightVCenter()));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("manufacturer", CAircraftIcaoCode::IndexManufacturer));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("desc.", "description", CAircraftIcaoCode::IndexModelDescription));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("code", "combined code", CAircraftIcaoCode::IndexCombinedAircraftType));
|
||||
this->m_columns.addColumn(CColumn::standardValueObject("WTC", "wake turbulence category", CAircraftIcaoCode::IndexWtc));
|
||||
this->m_columns.addColumn(CColumn("mil.", "military", CAircraftIcaoCode::IndexIsMilitary, new CBoolIconFormatter("military", "civil")));
|
||||
this->m_columns.addColumn(CColumn("VTOL", "vertical take-off and landing", CAircraftIcaoCode::IndexIsVtol, new CBoolIconFormatter("VTOL", "non VTOL")));
|
||||
this->m_columns.addColumn(CColumn("leg.", "legacy", CAircraftIcaoCode::IndexIsLegacy, new CBoolIconFormatter("legacy", "operating")));
|
||||
this->m_columns.addColumn(CColumn("real.", "real world aircraft", CAircraftIcaoCode::IndexIsRealworld, new CBoolIconFormatter("real", "non real")));
|
||||
this->m_columns.addColumn(CColumn::standardString("changed", CAircraftIcaoCode::IndexUtcTimestampFormattedYmdhms));
|
||||
|
||||
// default sort order
|
||||
this->setSortColumnByPropertyIndex(CAircraftIcaoCode::IndexAircraftDesignator);
|
||||
this->m_sortOrder = Qt::AscendingOrder;
|
||||
|
||||
// force strings for translation in resource files
|
||||
(void)QT_TRANSLATE_NOOP("ModelAircraftIcaoList", "ICAO");
|
||||
(void)QT_TRANSLATE_NOOP("ModelAircraftIcaoList", "distance");
|
||||
(void)QT_TRANSLATE_NOOP("ModelAircraftIcaoList", "name");
|
||||
(void)QT_TRANSLATE_NOOP("ModelAircraftIcaoList", "elevation");
|
||||
(void)QT_TRANSLATE_NOOP("ModelAircraftIcaoList", "bearing");
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
Reference in New Issue
Block a user