diff --git a/src/plugins/qmljseditor/qmljsoutline.cpp b/src/plugins/qmljseditor/qmljsoutline.cpp index 0bb319be6bd659472a55fd84ab8349a94b025f07..864dd4e69160d9e1c5f00336561b899a291e541f 100644 --- a/src/plugins/qmljseditor/qmljsoutline.cpp +++ b/src/plugins/qmljseditor/qmljsoutline.cpp @@ -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; diff --git a/src/plugins/qmljseditor/qmljsoutline.h b/src/plugins/qmljseditor/qmljsoutline.h index 65481b770ce954f59f2de7a21240ac97df7b1221..eda95d2350d800f9d881c77e045bc7aa6ad51a4b 100644 --- a/src/plugins/qmljseditor/qmljsoutline.h +++ b/src/plugins/qmljseditor/qmljsoutline.h @@ -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); diff --git a/src/plugins/qmljseditor/qmloutlinemodel.h b/src/plugins/qmljseditor/qmloutlinemodel.h index 6bfc59a9240a96182b026ca9f43d4879875eb9d3..42b07270da42a37e138e2180a32527a01a0abda3 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.h +++ b/src/plugins/qmljseditor/qmloutlinemodel.h @@ -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;