mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Ref T270, models/views for parts and situations
* added base class CListModelTimestampObjects * added model/view for CAircraftParts * added model/view for CAircraftSituation
This commit is contained in:
48
src/blackgui/models/listmodeltimestampobjects.h
Normal file
48
src/blackgui/models/listmodeltimestampobjects.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Copyright (C) 2018
|
||||
* 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_LISTMODELTIMESTAMPOBJECTS_H
|
||||
#define BLACKGUI_MODELS_LISTMODELTIMESTAMPOBJECTS_H
|
||||
|
||||
#include "blackgui/models/listmodelbase.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
#include <Qt>
|
||||
|
||||
class QModelIndex;
|
||||
class QObject;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Models
|
||||
{
|
||||
//! List model for timestamp based objects
|
||||
template <typename ObjectType, typename ContainerType, bool UseCompare = false> class CListModelTimestampObjects :
|
||||
public CListModelBase<ObjectType, ContainerType, UseCompare>
|
||||
{
|
||||
public:
|
||||
//! Destructor
|
||||
virtual ~CListModelTimestampObjects() {}
|
||||
|
||||
//! Insert as first element by keeping maxElements and the latest first
|
||||
void push_frontKeepLatestAdjustedFirst(const ObjectType &object, int max);
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
CListModelTimestampObjects(const QString &translationContext, QObject *parent = nullptr);
|
||||
|
||||
//! Standard timestamp offset columns
|
||||
void addTimestampOffsetColumns();
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user