From 77425eefec3e8fe944bc2361b18c97de112fed70 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 11 May 2014 16:54:37 +0200 Subject: 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 --- src/widgets/dialogs/qcolordialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 8866a3e97e..744666155a 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -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); -- cgit v1.2.3