Utils: Get default error color from Theme

The default Qt:red for the lineedit in  Utils::PathChooser is unreadable
in dark themes. This change ensures that the color comes from the
current theme.

Change-Id: I7b890bb18e4b996cf0a8f0ac3286da87dd33f5f2
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-07-25 00:47:50 +02:00
parent 98f7a00e70
commit 1acec7ceb4

View File

@@ -30,6 +30,7 @@
#include "synchronousprocess.h" #include "synchronousprocess.h"
#include "hostosinfo.h" #include "hostosinfo.h"
#include "theme/theme.h"
#include <QDebug> #include <QDebug>
#include <QFileDialog> #include <QFileDialog>
@@ -226,6 +227,7 @@ PathChooser::PathChooser(QWidget *parent) :
connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { emit pathChanged(path()); }); connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { emit pathChanged(path()); });
d->m_lineEdit->setMinimumWidth(120); d->m_lineEdit->setMinimumWidth(120);
d->m_lineEdit->setErrorColor(creatorTheme()->color(Theme::TextColorError));
d->m_hLayout->addWidget(d->m_lineEdit); d->m_hLayout->addWidget(d->m_lineEdit);
d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize); d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);