HAL
hexadecimal_validator.cpp
Go to the documentation of this file.
1
#include "
gui/validator/hexadecimal_validator.h
"
2
3
namespace
hal
4
{
5
HexadecimalValidator::HexadecimalValidator
()
6
{
7
//if 0x should also be allowed, use ^(0x|0X)?[a-fA-F0-9]+$
8
mValidator.
setRegularExpression
(
QRegularExpression
(
"^[A-F0-9]+$"
,
QRegularExpression::CaseInsensitiveOption
));
9
setFailText
(
"Cosen input must be in hexadecimal format."
);
10
}
11
12
bool
HexadecimalValidator::validate
(
const
QString
&input)
13
{
14
QString
inp =
input
;
int
pos = 0;
15
return
(mValidator.
validate
(inp, pos) == QValidator::State::Acceptable) ? true :
false
;
16
}
17
18
}
hal::HexadecimalValidator::validate
bool validate(const QString &input)
Definition:
hexadecimal_validator.cpp:12
hal::HexadecimalValidator::HexadecimalValidator
HexadecimalValidator()
Definition:
hexadecimal_validator.cpp:5
hal::Validator::setFailText
void setFailText(const QString &text)
Definition:
validator.cpp:5
hexadecimal_validator.h
hal
Definition:
parser_liberty.cpp:10
hal::PinDirection::input
@ input
QRegularExpression
QRegularExpression::CaseInsensitiveOption
CaseInsensitiveOption
QRegularExpressionValidator::setRegularExpression
void setRegularExpression(const QRegularExpression &re)
QRegularExpressionValidator::validate
virtual QValidator::State validate(QString &input, int &pos) const const override
QString
plugins
gui
src
validator
hexadecimal_validator.cpp
Generated on Fri Feb 14 2025 14:22:43 for HAL by
1.9.1