mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T417, flight plan follow ups
* fixed eventfilter, only allow ASCII values, disable in read only mode * set remarks values "from external" * set SELCAL value
This commit is contained in:
committed by
Mat Sutcliffe
parent
35b0836754
commit
be3283305a
@@ -245,6 +245,36 @@ namespace BlackGui
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGuiUtility::setComboBoxValueByContainingString(QComboBox *box, const QString &candidate, const QString &unspecified)
|
||||
{
|
||||
if (!box) { return false; }
|
||||
if (!candidate.isEmpty())
|
||||
{
|
||||
for (int i = 0; i < box->count(); i++)
|
||||
{
|
||||
const QString t(box->itemText(i));
|
||||
if (t.contains(candidate, Qt::CaseInsensitive))
|
||||
{
|
||||
box->setCurrentIndex(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// not found
|
||||
if (unspecified.isEmpty()) { return false; }
|
||||
for (int i = 0; i < box->count(); i++)
|
||||
{
|
||||
const QString t(box->itemText(i));
|
||||
if (t.contains(unspecified, Qt::CaseInsensitive))
|
||||
{
|
||||
box->setCurrentIndex(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CGuiUtility::hasSwiftVariantMimeType(const QMimeData *mime)
|
||||
{
|
||||
return mime && mime->hasFormat(swiftJsonDragAndDropMimeType());
|
||||
|
||||
Reference in New Issue
Block a user