#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QTextFrame>
-#if QT_VERSION >= 0x060000
-#include <QtCore5Compat/QRegExp>
-#endif
using namespace lyx::support;
if (f.isEmpty())
return s;
QString r(s);
-#if QT_VERSION < 0x060000
- QRegExp pattern(charFilterRegExpC(f));
-#else
QRegularExpression pattern(charFilterRegExpC(f));
-#endif
r.replace(pattern, "<u><b>\\1</b></u>");
return r;
}
lastSel_ = filterModel_->mapToSource(filterModel_->index(sel, 0)).row();
filter_ = s;
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
filterModel_->setFilterRegExp(charFilterRegExp(filter_));
#else
filterModel_->setFilterRegularExpression(charFilterRegExp(filter_));
}
-bool CategorizedCombo::set(QString const & item)
+bool CategorizedCombo::set(QString const & item, bool const report_missing)
{
d->resetFilter();
QList<QStandardItem *> r = d->model_->findItems(item, Qt::MatchExactly, 1);
if (r.empty()) {
- LYXERR0("Trying to select non existent layout type " << item);
+ if (report_missing)
+ LYXERR0("Trying to select non existent layout type " << item);
return false;
}