Make QColorDialog build under QT_NO_REGULAREXPRESSION

Since we can't set a validator on the HTML-color lineedit,
just make it readonly.

Change-Id: Ibeaacbea00867cdb6ef33b6667f7ee3539b7f929
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2014-05-11 16:54:37 +02:00 committed by The Qt Project
parent 70cd276db0
commit 77425eefec

View File

@ -1262,9 +1262,17 @@ QColorShower::QColorShower(QColorDialog *parent)
lblHtml->setBuddy(htEd);
#endif
#if !defined(QT_NO_REGULAREXPRESSION)
QRegularExpression regExp(QStringLiteral("#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})"));
QRegularExpressionValidator *validator = new QRegularExpressionValidator(regExp, this);
htEd->setValidator(validator);
#elif !defined(QT_NO_REGEXP)
QRegExp regExp(QStringLiteral("#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})"));
QRegExpValidator *validator = new QRegExpValidator(regExp, this);
htEd->setValidator(validator);
#else
htEd->setReadOnly(true);
#endif
lblHtml->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
gl->addWidget(lblHtml, 5, 1);