move error_matrixid label below matrixid input, made hide/show for the label, made red underline for invalid input, add to TextField class isValid() setValid() for custom validation

This commit is contained in:
kirillpt 2020-11-23 23:33:53 +03:00
parent 4032f6e113
commit ac73f10eba
3 changed files with 25 additions and 2 deletions

View file

@ -69,6 +69,18 @@ TextField::hasLabel() const
return show_label_;
}
bool
TextField::isValid() const
{
return is_valid_;
}
void
TextField::setValid(bool valid)
{
is_valid_ = valid;
}
void
TextField::setLabelFontSize(qreal size)
{
@ -147,7 +159,7 @@ QColor
TextField::underlineColor() const
{
if (!underline_color_.isValid()) {
if (hasAcceptableInput() || !isModified())
if (TextField::isValid() || !isModified())
return QPalette().color(QPalette::Highlight);
else
return Qt::red;