mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +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()
|
void CFilterWidget::triggerFilter()
|
||||||
{
|
{
|
||||||
this->ps_filterButtonClicked(CFilterBarButtons::Filter);
|
this->ps_filterButtonClicked(CFilterBarButtons::Filter);
|
||||||
@@ -67,6 +76,5 @@ namespace BlackGui
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ namespace BlackGui
|
|||||||
//! Clear the filter form
|
//! Clear the filter form
|
||||||
virtual void clearForm() = 0;
|
virtual void clearForm() = 0;
|
||||||
|
|
||||||
|
//! Convert DB id
|
||||||
|
static int convertDbId(const QString &candidate);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Button clicked
|
//! Button clicked
|
||||||
void ps_filterButtonClicked(CFilterBarButtons::FilterButton filterButton);
|
void ps_filterButtonClicked(CFilterBarButtons::FilterButton filterButton);
|
||||||
@@ -64,7 +67,6 @@ namespace BlackGui
|
|||||||
//! Stylesheet changed
|
//! Stylesheet changed
|
||||||
void ps_onStyleSheetChanged();
|
void ps_onStyleSheetChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user