11 #include "ui_dbairlinenameselectorcomponent.h"
21 using namespace swift::misc::aviation;
22 using namespace swift::misc::db;
26 CDbAirlineNameSelectorComponent::CDbAirlineNameSelectorComponent(
QWidget *parent)
32 &CDbAirlineNameSelectorComponent::ps_dataChanged);
41 ui->le_AirlineName->setText(name);
54 c->setMaxVisibleItems(10);
55 const int w5chars = c->popup()->fontMetrics().size(
Qt::TextSingleLine,
"FooBa").width();
56 c->popup()->setMinimumWidth(w5chars * 10);
57 ui->le_AirlineName->setCompleter(c);
61 void CDbAirlineNameSelectorComponent::ps_dataChanged()
63 if (!
sGui) {
return; }
64 QString s(ui->le_AirlineName->text());
65 if (s.isEmpty()) {
return; }
66 int dbKey = CDatastoreUtility::extractIntegerKey(s);
CWebDataServices * getWebDataServices() const
Get the web data services.
swift::misc::aviation::CAirlineIcaoCode getAirlineIcaoCodeForDbKey(int key) const
ICAO code for id.
swift::misc::aviation::CAirlineIcaoCodeList getAirlineIcaoCodes() const
Airline ICAO codes.
Airline ICAO selector base class.
virtual bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao)
Current airline ICAO.
void setReadOnly(bool readOnly)
Read only.
QCompleter * createCompleter()
Create a new completer.
~CDbAirlineNameSelectorComponent()
Destructor.
void clear()
Clear selection.
bool setAirlineIcao(const swift::misc::aviation::CAirlineIcaoCode &icao)
Current airline ICAO.
Value object for ICAO classification.
const QString & getName() const
Get name, e.g. "Lufthansa".
QStringList toNameCompleterStrings(bool sort=true) const
String list for completion by name.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Backend services of the swift project, like dealing with the network or the simulators.
High level reusable GUI components.
Free functions in swift::misc.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)