mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 02:06:08 +08:00
Ref T111, UI element for model key completion
This commit is contained in:
committed by
Mathew Sutcliffe
parent
b1295cd457
commit
a1357f0bd7
50
src/blackgui/components/dbmodelkeycompleter.h
Normal file
50
src/blackgui/components/dbmodelkeycompleter.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/* Copyright (C) 2017
|
||||
* 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_COMPONENTS_DBMODELKEYCOMPLETER_H
|
||||
#define BLACKGUI_COMPONENTS_DBMODELKEYCOMPLETER_H
|
||||
|
||||
#include "blackmisc/simulation/simulatorinfo.h"
|
||||
#include "blackmisc/simulation/aircraftmodel.h"
|
||||
#include <QLineEdit>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/**
|
||||
* Completer for model keys
|
||||
*/
|
||||
class CDbModelKeyCompleter : public QLineEdit
|
||||
{
|
||||
public:
|
||||
//! Ctor
|
||||
CDbModelKeyCompleter(QWidget *parent = nullptr);
|
||||
|
||||
//! Limit models to simulator, or add unspecified
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
//! Aircraft model for current string (searched in DB data)
|
||||
BlackMisc::Simulation::CAircraftModel getAircraftModel() const;
|
||||
|
||||
private:
|
||||
//! Models have been read
|
||||
void onModelsRead();
|
||||
|
||||
//! Init completer
|
||||
void initCompleter();
|
||||
|
||||
BlackMisc::Simulation::CSimulatorInfo m_simulator { BlackMisc::Simulation::CSimulatorInfo::All };
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user