swift
Loading...
Searching...
No Matches
aircraftcategorylistmodel.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <Qt>
7#include <QtGlobal>
8
10#include "gui/models/columns.h"
11#include "misc/db/datastore.h"
12#include "misc/timestampbased.h"
13
14using namespace swift::misc::aviation;
15
16namespace swift::gui::models
17{
19 : CListModelDbObjects("AircraftCategoryListModel", parent)
20 {
21 m_columns.addColumn(CColumn::standardString("id", CAircraftCategory::IndexDbIntegerKey,
23 m_columns.addColumn(CColumn::standardString("level", CAircraftCategory::IndexLevelString));
24 m_columns.addColumn(CColumn::standardString("path", CAircraftCategory::IndexPath));
25 m_columns.addColumn(CColumn::standardString("name", CAircraftCategory::IndexName));
26 m_columns.addColumn(CColumn::standardString("description", CAircraftCategory::IndexDescription));
27 m_columns.addColumn(CColumn::standardString("changed", CAircraftCategory::IndexUtcTimestampFormattedYmdhms));
28
29 // default sort order
30 this->setSortColumnByPropertyIndex(CAircraftCategory::IndexLevelString);
32 }
33} // namespace swift::gui::models
CAircraftCategoryListModel(QObject *parent=nullptr)
Constructor.
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
Definition columns.cpp:57
static int alignRightVCenter()
Align right/vertically centered.
virtual bool setSortColumnByPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Set column for sorting.
QModelIndex parent(const QModelIndex &child) const final
Models to be used with views, mainly QTableView.
QObject(QObject *parent)
AscendingOrder