diff options
Diffstat (limited to 'src/gui/kernel/qplatformdialoghelper.cpp')
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 628ad06478..d14d575056 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -41,6 +41,7 @@ #include <QtCore/QCoreApplication> #include <QtCore/QVariant> +#include <QtCore/QRegularExpression> #include <QtCore/QSharedData> #if QT_CONFIG(settings) #include <QtCore/QSettings> @@ -63,6 +64,18 @@ QT_BEGIN_NAMESPACE */ +/*! + \enum QPlatformDialogHelper::StyleHint + + This enum type specifies platform-specific style hints. + + \value DialogIsQtWindow Indicates that a platform-specific dialog is implemented + as in-process Qt window. It allows to prevent blocking the + dialog by an invisible proxy Qt dialog. + + \sa styleHint() +*/ + static const int buttonRoleLayouts[2][6][14] = { // Qt::Horizontal @@ -767,18 +780,19 @@ void QPlatformFileDialogHelper::setOptions(const QSharedPointer<QFileDialogOptio m_options = options; } -const char *QPlatformFileDialogHelper::filterRegExp = +const char QPlatformFileDialogHelper::filterRegExp[] = "^(.*)\\(([a-zA-Z0-9_.,*? +;#\\-\\[\\]@\\{\\}/!<>\\$%&=^~:\\|]*)\\)$"; // Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)" QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter) { - QRegExp regexp(QString::fromLatin1(filterRegExp)); + QRegularExpression regexp(QString::fromLatin1(filterRegExp)); Q_ASSERT(regexp.isValid()); QString f = filter; - int i = regexp.indexIn(f); - if (i >= 0) - f = regexp.cap(2); + QRegularExpressionMatch match; + filter.indexOf(regexp, 0, &match); + if (match.hasMatch()) + f = match.captured(2); return f.split(QLatin1Char(' '), QString::SkipEmptyParts); } |