Commit 72862dcc authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlOutline: Show id/name/property values only if filter is active

parent 0783b1e4
......@@ -40,6 +40,18 @@ bool QmlJSOutlineFilterModel::filterAcceptsRow(int sourceRow,
return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
}
QVariant QmlJSOutlineFilterModel::data(const QModelIndex &index, int role) const
{
if (role == QmlOutlineModel::AnnotationRole) {
// Don't show element id etc behind element if the property is also visible
if (!filterBindings()
&& index.data(QmlOutlineModel::ItemTypeRole) == QmlOutlineModel::ElementType) {
return QVariant();
}
}
return QSortFilterProxyModel::data(index, role);
}
bool QmlJSOutlineFilterModel::filterBindings() const
{
return m_filterBindings;
......
......@@ -28,6 +28,7 @@ public:
// QSortFilterProxyModel
bool filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const;
QVariant data(const QModelIndex &index, int role) const;
bool filterBindings() const;
void setFilterBindings(bool filterBindings);
......
......@@ -26,7 +26,7 @@ class QmlOutlineItem : public QStandardItem
public:
QmlOutlineItem(QmlOutlineModel *model);
//QStandardItem
// QStandardItem
QVariant data(int role = Qt::UserRole + 1) const;
int type() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment