Skip to content

Commit

Permalink
Support regular expression patterns in the property list filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Knight committed Nov 8, 2013
1 parent 2e07d1e commit 09149bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions ObjectInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 26,8 @@ ObjectInspector::ObjectInspector(QWidget* parent)
QHBoxLayout* filterLayout = new QHBoxLayout;
QLabel* filterLabel = new QLabel(tr("Filter:"),this);
m_propertyFilterEdit = new QLineEdit(this);
m_propertyFilterEdit->setToolTip(tr("String or regular expression to filter property list with"));

connect(m_propertyFilterEdit,SIGNAL(textChanged(QString)),
this,SLOT(changeFilter(QString)));
filterLayout->addWidget(filterLabel);
Expand Down Expand Up @@ -81,8 83,8 @@ ObjectProxy::Pointer ObjectInspector::object() const
return m_currentObject;
}

void ObjectInspector::changeFilter(const QString& text)
void ObjectInspector::changeFilter(const QString& pattern)
{
m_propertySortModel->setFilterFixedString(text);
m_propertySortModel->setFilterRegExp(QRegExp(pattern));
}

2 changes: 1 addition & 1 deletion ObjectInspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 27,7 @@ class ObjectInspector : public QWidget
void refresh();

private Q_SLOTS:
void changeFilter(const QString& text);
void changeFilter(const QString& pattern);

private:
QLabel* m_nameLabel;
Expand Down

0 comments on commit 09149bb

Please sign in to comment.