diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-05-11 16:54:37 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-15 02:51:06 +0200 |
commit | 77425eefec3e8fe944bc2361b18c97de112fed70 (patch) | |
tree | 88d667cd80a9278f06dc97cc1c026d60aeb59b12 /src/widgets/dialogs/qcolordialog.cpp | |
parent | 70cd276db01de8a9ccabb60282f00068b3840b88 (diff) |
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>
Diffstat (limited to 'src/widgets/dialogs/qcolordialog.cpp')
-rw-r--r-- | src/widgets/dialogs/qcolordialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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); |