Fix standalone grabbers (#1384)

* Fix too much copy/paste
* Fix typo
* Commandlineoptions: Additional error details for Int and Double ranges
* Standalone grabbers: Show fps range on error, fix default host address
This commit is contained in:
LordGrey
2021-11-29 17:51:03 +00:00
committed by GitHub
parent 926a58de9c
commit e3b494428a
16 changed files with 84 additions and 36 deletions

View File

@@ -12,6 +12,8 @@ class IntOption: public ValidatorOption
{
protected:
int _int;
int _minimum;
int _maximum;
public:
IntOption(const QString &name,
@@ -31,18 +33,24 @@ public:
int minimum = std::numeric_limits<int>::min(), int maximum = std::numeric_limits<int>::max())
: ValidatorOption(names, description, valueName, defaultValue)
{
setValidator(new QIntValidator(minimum, maximum));
_minimum = minimum;
_maximum = maximum;
setValidator(new QIntValidator(_minimum, _maximum));
}
IntOption(const QCommandLineOption &other,
int minimum = std::numeric_limits<int>::min(), int maximum = std::numeric_limits<int>::max())
: ValidatorOption(other)
{
setValidator(new QIntValidator(minimum, maximum));
_minimum = minimum;
_maximum = maximum;
setValidator(new QIntValidator(_minimum, _maximum));
}
int getInt(Parser &parser, bool *ok = 0, int base = 10);
int *getIntPtr(Parser &parser, bool *ok = 0, int base = 10);
bool validate(Parser & parser, QString & value) override;
};
}