1 #include "apitracefilter.h"
3 #include "apitracecall.h"
4 #include "apitracemodel.h"
8 ApiTraceFilter::ApiTraceFilter(QObject *parent)
9 : QSortFilterProxyModel()
13 bool ApiTraceFilter::filterAcceptsRow(int sourceRow,
14 const QModelIndex &sourceParent) const
16 QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
17 QVariant varientData = sourceModel()->data(index0, ApiTraceModel::EventRole);
18 ApiTraceEvent *event = varientData.value<ApiTraceEvent*>();
24 //we don't filter frames
25 if (event->type() == ApiTraceEvent::Frame) {
29 ApiTraceCall *call = static_cast<ApiTraceCall*>(event);
30 QString function = call->name;
32 if (!m_text.isEmpty()) {
33 return function.contains(m_text);
36 //XXX make it configurable
37 if (function.contains(QLatin1String("glXGetProcAddress")))
39 if (function.contains(QLatin1String("wglGetProcAddress")))
42 QString fullText = call->filterText();
43 if (function.contains(QLatin1String("glGetString")) &&
44 fullText.contains(QLatin1String("GL_EXTENSIONS")))
51 void ApiTraceFilter::setFilterString(const QString &text)
59 #include "apitracefilter.moc"