PathChooser: Add interface to set ok/error color for lineedit

Change-Id: I4fcd72e8b9281d1cdb404ccc268c453417ec35db
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-10-13 15:16:08 +02:00
parent 2e8332088b
commit 981f7411d3
2 changed files with 28 additions and 0 deletions

View File

@@ -336,6 +336,16 @@ void PathChooser::setFileName(const FileName &fn)
d->m_lineEdit->setText(fn.toUserOutput());
}
void PathChooser::setErrorColor(const QColor &errorColor)
{
d->m_lineEdit->setErrorColor(errorColor);
}
void PathChooser::setOkColor(const QColor &okColor)
{
d->m_lineEdit->setOkColor(okColor);
}
bool PathChooser::isReadOnly() const
{
return d->m_lineEdit->isReadOnly();
@@ -461,6 +471,16 @@ void PathChooser::setAboutToShowContextMenuHandler(PathChooser::AboutToShowConte
s_aboutToShowContextMenuHandler = handler;
}
QColor PathChooser::errorColor() const
{
return d->m_lineEdit->errorColor();
}
QColor PathChooser::okColor() const
{
return d->m_lineEdit->okColor();
}
FancyLineEdit::ValidationFunction PathChooser::defaultValidationFunction() const
{
return std::bind(&PathChooser::validatePath, this, std::placeholders::_1, std::placeholders::_2);