10 #include "ui_selcalcodeselector.h"
16 using namespace swift::misc::aviation;
24 this->setValidityHint();
25 ui->lblp_ValidCodeIcon->setToolTips(
"valid SELCAL",
"invalid SELCAL");
28 ui->cb_SelcalPairs1->setStyleSheet(
"combobox-popup: 0;");
29 ui->cb_SelcalPairs2->setStyleSheet(
"combobox-popup: 0;");
32 &CSelcalCodeSelector::selcalIndexChanged);
34 &CSelcalCodeSelector::selcalIndexChanged);
41 QString selcal = ui->cb_SelcalPairs1->currentText();
42 selcal.
append(ui->cb_SelcalPairs2->currentText());
54 ui->cb_SelcalPairs1->clear();
55 if (allowEmptyValue) ui->cb_SelcalPairs1->addItem(
" ");
57 ui->cb_SelcalPairs2->clear();
58 if (allowEmptyValue) ui->cb_SelcalPairs2->addItem(
" ");
65 if (s.
length() != 4) {
return; }
81 if (s.
length() != 4)
return false;
88 ui->cb_SelcalPairs1->setCurrentIndex(0);
89 ui->cb_SelcalPairs2->setCurrentIndex(0);
96 ui->cb_SelcalPairs1->setMinimumHeight(h);
97 ui->cb_SelcalPairs2->setMinimumHeight(h);
100 void CSelcalCodeSelector::selcalIndexChanged(
int index)
103 this->setValidityHint();
107 void CSelcalCodeSelector::setValidityHint() { ui->lblp_ValidCodeIcon->setTicked(this->
hasValidCode()); }
void valueChanged()
Value has been changed.
QString getSelcalCode() const
SELCAL code.
void setComboBoxMinimumHeight(int h)
Set the combobox height.
swift::misc::aviation::CSelcal getSelcal() const
SELCAL.
int getComboBoxHeight() const
The height of the combobox.
void resetSelcalCodes(bool allowEmptyValue=false)
Reset the SELCAL code.
void setSelcalCode(const QString &selcal)
Set the SELCAL code.
virtual ~CSelcalCodeSelector()
Destructor.
void setSelcal(const swift::misc::aviation::CSelcal &selcal)
Set the SELCAL code.
bool hasValidCode() const
Valid code?
const QString & getCode() const
Get SELCAL code.
static const QStringList & codePairs()
All valid code pairs: AB, AC, AD ...
static bool isValidCode(const QString &code)
Valid SELCAL code?
High level reusable GUI components.
Free functions in swift::misc.
void currentIndexChanged(int index)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString & append(QChar ch)
bool isEmpty() const const
QString left(qsizetype n) &&
qsizetype length() const const
QString right(qsizetype n) &&
QString toUpper() const const
QString trimmed() const const