Ref T689 Settings validation can produce more descriptive error messages.

This commit is contained in:
Mat Sutcliffe
2019-06-23 17:08:45 +01:00
parent 6f9f6ccc9d
commit 668a77d083
16 changed files with 34 additions and 21 deletions

View File

@@ -444,7 +444,10 @@ namespace BlackMisc
private:
template <typename F>
static Private::CValuePage::Validator wrap(F func) { return [func](const CVariant &value)->bool { return func(value.to<T>()); }; }
static Private::CValuePage::Validator wrap(F func)
{
return [func](const CVariant &value, QString &reason) -> bool { return func(value.to<T>(), reason); };
}
static Private::CValuePage::Validator wrap(std::nullptr_t) { return {}; }
template <typename F>