mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
Ref T75, utility function
This commit is contained in:
@@ -39,6 +39,15 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
int CFilterWidget::convertDbId(const QString &candidate)
|
||||
{
|
||||
const QString s = candidate.trimmed();
|
||||
if (s.isEmpty()) { return -1; }
|
||||
bool ok = false;
|
||||
const int id = s.toInt(&ok);
|
||||
return ok && id >= 0 ? id : -1;
|
||||
}
|
||||
|
||||
void CFilterWidget::triggerFilter()
|
||||
{
|
||||
this->ps_filterButtonClicked(CFilterBarButtons::Filter);
|
||||
@@ -67,6 +76,5 @@ namespace BlackGui
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -57,6 +57,9 @@ namespace BlackGui
|
||||
//! Clear the filter form
|
||||
virtual void clearForm() = 0;
|
||||
|
||||
//! Convert DB id
|
||||
static int convertDbId(const QString &candidate);
|
||||
|
||||
private slots:
|
||||
//! Button clicked
|
||||
void ps_filterButtonClicked(CFilterBarButtons::FilterButton filterButton);
|
||||
@@ -64,7 +67,6 @@ namespace BlackGui
|
||||
//! Stylesheet changed
|
||||
void ps_onStyleSheetChanged();
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
||||
Reference in New Issue
Block a user