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:
Klaus Basan
2015-09-23 23:56:17 +02:00
committed by Mathew Sutcliffe
parent f9048de1e6
commit 2c91b3ada0
41 changed files with 1375 additions and 123 deletions

View File

@@ -0,0 +1,41 @@
/* 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 "countrylistmodel.h"
#include "blackmisc/blackmiscfreefunctions.h"
#include <QMetaProperty>
using namespace BlackMisc;
namespace BlackGui
{
namespace Models
{
CCountryListModel::CCountryListModel(QObject *parent) :
CListModelBase<BlackMisc::CCountry, BlackMisc::CCountryList>("CountryListModel", parent)
{
CColumn col("country", CCountry::IndexIcon);
col.setSortPropertyIndex(CCountry::IndexIsoCode);
this->m_columns.addColumn(col);
this->m_columns.addColumn(CColumn::standardString("ISO", CCountry::IndexIsoCode));
this->m_columns.addColumn(CColumn::standardString("name", CCountry::IndexName));
this->m_columns.addColumn(CColumn::standardString("changed", CCountry::IndexUtcTimestampFormattedYmdhms));
// default sort order
this->setSortColumnByPropertyIndex(CCountry::IndexIsoCode);
this->m_sortOrder = Qt::AscendingOrder;
// force strings for translation in resource files
(void)QT_TRANSLATE_NOOP("ModelCountryList", "cty.");
(void)QT_TRANSLATE_NOOP("ModelCountryList", "country");
(void)QT_TRANSLATE_NOOP("ModelCountryList", "ISO");
(void)QT_TRANSLATE_NOOP("ModelCountryList", "name");
}
} // ns
} // ns