if (!hints.isEmpty()) {
rc.includeHints = hints.split(QString(QLatin1Char('\n')));
// Purge out any lines consisting of blanks only
- const QRegExp blankLine = QRegExp(QStringLiteral("^\\s*$"));
+ QRegExp blankLine = QRegExp(QStringLiteral("^\\s*$"));
Q_ASSERT(blankLine.isValid());
for (QStringList::iterator it = rc.includeHints.begin(); it != rc.includeHints.end(); )
if (blankLine.exactMatch(*it)) {
static bool isIntegerList(const QString &s)
{
// Check for empty string or comma-separated list of integers
- static const QRegExp re(QStringLiteral("[0-9]+(,[0-9]+)+"));
+ static QRegExp re(QStringLiteral("[0-9]+(,[0-9]+)+"));
Q_ASSERT(re.isValid());
return s.isEmpty() || re.exactMatch(s);
}
{
QWidget *result = QItemDelegate::createEditor(parent, option, index);
if (QLineEdit *line_edit = qobject_cast<QLineEdit*>(result)) {
- const QRegExp re = QRegExp(QStringLiteral("[_a-zA-Z][_a-zA-Z0-9]*"));
+ QRegExp re = QRegExp(QStringLiteral("[_a-zA-Z][_a-zA-Z0-9]*"));
Q_ASSERT(re.isValid());
line_edit->setValidator(new QRegExpValidator(re, line_edit));
}
void WidgetBoxTreeWidget::filter(const QString &f)
{
const bool empty = f.isEmpty();
- const QRegExp re = empty ? QRegExp() : QRegExp(f, Qt::CaseInsensitive, QRegExp::FixedString);
+ QRegExp re = empty ? QRegExp() : QRegExp(f, Qt::CaseInsensitive, QRegExp::FixedString);
const int numTopLevels = topLevelItemCount();
bool changed = false;
for (int i = 0; i < numTopLevels; i++) {
void updateOkButton();
// Check for buddy marker in string
- const QRegExp m_buddyMarkerRegexp;
+ QRegExp m_buddyMarkerRegexp;
Ui::FormLayoutRowDialog m_ui;
bool m_labelNameEdited;
QString pattern = QStringLiteral("^<widget\\s+class\\s*=\\s*\"");
pattern += className;
pattern += QStringLiteral("\".*$");
- const QRegExp regexp(pattern);
+ QRegExp regexp(pattern);
Q_ASSERT(regexp.isValid());
const int catCount = wbox->categoryCount();
for (int c = 0; c < catCount; c++) {
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
private:
- const QRegExp m_signatureRegexp;
- const QRegExp m_methodNameRegexp;
+ QRegExp m_signatureRegexp;
+ QRegExp m_methodNameRegexp;
};
SignatureDelegate::SignatureDelegate(QObject * parent) :
Q_ASSERT(le);
// Did the user just type a name? .. Add parentheses
QString signature = le->text();
- if (!m_signatureRegexp.exactMatch(signature )) {
- if (m_methodNameRegexp.exactMatch(signature )) {
+ QRegExp signatureRegexp = m_signatureRegexp;
+ QRegExp methodNameRegexp = m_methodNameRegexp;
+ if (!signatureRegexp.exactMatch(signature )) {
+ if (methodNameRegexp.exactMatch(signature )) {
signature += QStringLiteral("()");
le->setText(signature);
} else {
QUrl UrlValidator::guessUrlFromString(const QString &string) const
{
const QString urlStr = string.trimmed();
- const QRegExp qualifiedUrl(QStringLiteral("^[a-zA-Z]+\\:.*"));
+ QRegExp qualifiedUrl(QStringLiteral("^[a-zA-Z]+\\:.*"));
// Check if it looks like a qualified URL. Try parsing it and see.
const bool hasSchema = qualifiedUrl.exactMatch(urlStr);
void TextPropertyEditor::setRegExpValidator(const QString &pattern)
{
- const QRegExp regExp(pattern);
+ QRegExp regExp(pattern);
Q_ASSERT(regExp.isValid());
m_lineEdit->setValidator(new QRegExpValidator(regExp,m_lineEdit));
}