mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
44 lines
1.8 KiB
C++
44 lines
1.8 KiB
C++
/* Copyright (C) 2016
|
|
* 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 "windlayerlistmodel.h"
|
|
#include "columnformatters.h"
|
|
|
|
#include <Qt>
|
|
#include <QtGlobal>
|
|
|
|
using namespace BlackMisc;
|
|
using namespace BlackMisc::PhysicalQuantities;
|
|
using namespace BlackMisc::Weather;
|
|
|
|
namespace BlackGui
|
|
{
|
|
namespace Models
|
|
{
|
|
CWindLayerListModel::CWindLayerListModel(QObject *parent) :
|
|
CListModelBase("WindLayerListModel", parent)
|
|
{
|
|
this->m_columns.addColumn(CColumn("level", CWindLayer::IndexLevel, new CAltitudeFormatter()));
|
|
this->m_columns.addColumn(CColumn("direction", CWindLayer::IndexDirection, new CAngleDegreeFormatter()));
|
|
this->m_columns.addColumn(CColumn("speed", CWindLayer::IndexSpeed, new CSpeedKtsFormatter()));
|
|
this->m_columns.addColumn(CColumn("gust speed", CWindLayer::IndexGustSpeed, new CSpeedKtsFormatter()));
|
|
|
|
// default sort order
|
|
this->setSortColumnByPropertyIndex(CWindLayer::IndexLevel);
|
|
this->m_sortOrder = Qt::AscendingOrder;
|
|
|
|
// force strings for translation in resource files
|
|
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "level");
|
|
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "direction");
|
|
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "speed");
|
|
(void)QT_TRANSLATE_NOOP("ModelWindLayerList", "gust speed");
|
|
}
|
|
} // ns
|
|
} // ns
|