diff options
Diffstat (limited to 'src/qtivisupport.cpp')
-rw-r--r-- | src/qtivisupport.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/qtivisupport.cpp b/src/qtivisupport.cpp index 7a772a0..ae2b233 100644 --- a/src/qtivisupport.cpp +++ b/src/qtivisupport.cpp @@ -27,23 +27,45 @@ ****************************************************************************/ #include "qtivisupport.h" +#include "qtivipropertymodel.h" #include <core/metaobject.h> #include <core/metaobjectrepository.h> +#include <core/objecttypefilterproxymodel.h> #include <QIviAbstractFeature> #include <QIviServiceObject> #include <QIviZonedFeatureInterface> +#include <QIviProperty> #include <QDebug> using namespace GammaRay; +using PropertyFilterModel = ObjectTypeFilterProxyModel<QIviProperty>; QtIviSupport::QtIviSupport(ProbeInterface* probe, QObject* parent) : QObject(parent) { Q_UNUSED(probe); registerMetaTypes(); + + auto const filterModel = new PropertyFilterModel(this); + filterModel->setDynamicSortFilter(true); + filterModel->setSourceModel(probe->objectListModel()); + + auto propertyModel = new QtIVIPropertyModel(this); + propertyModel->setSourceModel(filterModel); + + connect(propertyModel, &QtIVIPropertyModel::dataChanged, [propertyModel](const QModelIndex& tl, const QModelIndex& br) + { + qDebug() << "index tl: " << tl; + qDebug() << "index br: " << br; + qDebug() << "got data changed event"; + qDebug() << propertyModel->data(tl); + }); + + probe->registerModel(QStringLiteral("com.kdab.GammaRay.PropertyModel"), propertyModel); + //m_selectionModel = ObjectBroker::selectionModel(filterModel); } void QtIviSupport::registerMetaTypes() @@ -62,4 +84,3 @@ void QtIviSupport::registerMetaTypes() MO_ADD_METAOBJECT1(QIviZonedFeatureInterface, QObject); MO_ADD_PROPERTY_RO(QIviZonedFeatureInterface, QStringList, availableZones); } - |