6 QSortFilterProxyModel (parent)
49 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::Wildcard );
52 else if( mode ==
REGEX){
53 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::RegExp2 );
66 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::Wildcard );
69 else if( mode ==
REGEX){
70 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::RegExp2 );
82 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::Wildcard );
85 else if( mode ==
REGEX){
86 QRegExp regexp( filter, Qt::CaseSensitive, QRegExp::RegExp2 );
125 QModelIndex index_time = sourceModel()->index(sourceRow, 1, sourceParent);
126 QModelIndex index_severity = sourceModel()->index(sourceRow, 2, sourceParent);
127 QModelIndex index_node = sourceModel()->index(sourceRow, 3, sourceParent);
128 QModelIndex index_message = sourceModel()->index(sourceRow, 4, sourceParent);
129 QModelIndex index_source = sourceModel()->index(sourceRow, 5, sourceParent);
131 int severity = sourceModel()->data( index_severity, Qt::UserRole ).toInt();
140 int64_t usec = sourceModel()->data( index_time, Qt::UserRole ).toLongLong();
141 auto timestamp =
TimePoint() + std::chrono::microseconds(usec);
143 if( timestamp < _min || timestamp >
_max ){
149 const QString& text = sourceModel()->data( index_message, Qt::UserRole ).toString();
157 const QString& text = sourceModel()->data( index_source, Qt::UserRole ).toString();
165 const QString& text = sourceModel()->data( index_node, Qt::UserRole ).toString();
178 const QString& text_to_parse,
179 const QRegExpValidator* validator )
const 183 if(filter.count() == 0 )
188 assert( !( validator ==
nullptr && (mode ==
WILDCARDS || mode ==
REGEX) ) );
192 QStringList filter_words = filter.split(QRegExp(
"\\s"), QString::SkipEmptyParts);
194 for (
int i=0;
i< filter_words.size();
i++){
195 if( text_to_parse.contains(filter_words[
i], Qt::CaseSensitive) == true ){
204 QString message = text_to_parse;
206 return validator->validate( message, pos ) == QValidator::Acceptable;
QRegExpValidator _msg_validator
std::chrono::high_resolution_clock::time_point TimePoint
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
bool _error_filter_enabled
void timeMinMaxUpdated(TimePoint min, TimePoint max)
bool _time_filter_enabled
bool _debug_filter_enabled
void setSourceFilterEnabled(bool enabled)
void sourceFilterUpdated(FilterMode mode, const QString &text)
QRegExpValidator _source_validator
void setNodeFilterEnabled(bool enabled)
void messageFilterUpdated(FilterMode mode, const QString &text)
void setSeverityInfoEnabled(bool enabled)
void setSeverityErrorEnabled(bool enabled)
bool _info_filter_enabled
bool _source_filter_enabled
void setTimeFilterEnabled(bool enabled)
QRegExpValidator _node_validator
void nodeFilterUpdated(FilterMode mode, const QString &text)
void setSeverityDebugEnabled(bool enabled)
void setSeverityWarningsEnabled(bool enabled)
bool applyFilter(const QString &filter, ModelFilter::FilterMode mode, const QString &text_to_parse, const QRegExpValidator *validator) const
void setMessageFilterEnabled(bool enabled)
bool _warn_filter_enabled
ModelFilter(QObject *parent=0)
bool _node_filter_enabled